[PATCH v6 02/12] preload-index: add override to enable testing preload-index
- From
Ben Peart <benpeart@microsoft.com>
- Date
- Sep 15, 2017, 19:20 UTC
- Message-ID
- <20170915192043.4516-3-benpeart@microsoft.com>
- In-Reply-To
- <20170915192043.4516-1-benpeart@microsoft.com>
Preload index doesn't run unless it has a minimum number of 1000 files. To enable running tests with fewer files, add an environment variable (GIT_FORCE_PRELOAD_TEST) which will override that minimum and set it to 2.
Signed-off-by: Ben Peart <benpeart@microsoft.com> --- 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.548.ge54b1befee.dirty