preload-index: add override to enable testing preload-index
[gitweb.git] / preload-index.c
index 70a4c808783bab92b4b6319e3dbd8e16641b1918..75564c497a6e55f6f5f7d13d1ab25c40ed5ed423 100644 (file)
@@ -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)