Thread (93 messages) 93 messages, 11 authors, 2017-09-24

[PATCH v8 02/12] preload-index: add override to enable testing preload-index

flat view
STALE3302d

From: Ben Peart <hidden>
Date: 2017-09-22 16:36:22
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v8 of 3 in this series.

Revisions (3)
  1. v6 [diff vs current]
  2. v7 [diff vs current]
  3. v8 current
By default, the preload index code path doesn't run unless there is a
minimum of 1000 files. To enable running the test suite and having it
execute the preload-index path, add an environment variable
(GIT_FORCE_PRELOAD_TEST) which will override that minimum and set it to 2.

This enables you run existing tests and have the core.preloadindex code
path execute as long as the test has at least 2 files by setting
GIT_FORCE_PRELOAD_TEXT=1 before running the test.

Signed-off-by: Ben Peart <redacted>
---
 preload-index.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/preload-index.c b/preload-index.c
index 70a4c80878..75564c497a 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -79,6 +79,8 @@ static void preload_index(struct index_state *index,
 		return;
 
 	threads = index->cache_nr / THREAD_COST;
+	if ((index->cache_nr > 1) && (threads < 2) && getenv("GIT_FORCE_PRELOAD_TEST"))
+		threads = 2;
 	if (threads < 2)
 		return;
 	if (threads > MAX_PARALLEL)
-- 
2.14.1.549.g6ff7ed0467
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help