rebase -i: include MERGE_HEAD into files to clean up
[gitweb.git] / preload-index.c
index 2541b307e8bafc7280c0ded43346a0d723af1768..9e7152ab14d9359d0a48da8b25cd58253a13fc0c 100644 (file)
@@ -5,6 +5,7 @@
 #include "pathspec.h"
 #include "dir.h"
 #include "fsmonitor.h"
+#include "config.h"
 #include "progress.h"
 
 #ifdef NO_PTHREADS
@@ -105,17 +106,17 @@ static void preload_index(struct index_state *index,
 {
        int threads, i, work, offset;
        struct thread_data data[MAX_PARALLEL];
-       uint64_t start = getnanotime();
        struct progress_data pd;
 
        if (!core_preload_index)
                return;
 
        threads = index->cache_nr / THREAD_COST;
-       if ((index->cache_nr > 1) && (threads < 2) && getenv("GIT_FORCE_PRELOAD_TEST"))
+       if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_TEST_PRELOAD_INDEX", 0))
                threads = 2;
        if (threads < 2)
                return;
+       trace_performance_enter();
        if (threads > MAX_PARALLEL)
                threads = MAX_PARALLEL;
        offset = 0;
@@ -148,7 +149,7 @@ static void preload_index(struct index_state *index,
        }
        stop_progress(&pd.progress);
 
-       trace_performance_since(start, "preload index");
+       trace_performance_leave("preload index");
 }
 #endif