]> git.ipfire.org Git - thirdparty/git.git/blobdiff - read-cache.c
Merge branch 'bp/refresh-index-using-preload'
[thirdparty/git.git] / read-cache.c
index f3a848d61c154ec99b4c45d3404380810c18eec1..8c924506dd96037c1d7c0fa93e4223f9274a851f 100644 (file)
@@ -1496,6 +1496,12 @@ int refresh_index(struct index_state *istate, unsigned int flags,
        typechange_fmt = (in_porcelain ? "T\t%s\n" : "%s needs update\n");
        added_fmt = (in_porcelain ? "A\t%s\n" : "%s needs update\n");
        unmerged_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
+       /*
+        * Use the multi-threaded preload_index() to refresh most of the
+        * cache entries quickly then in the single threaded loop below,
+        * we only have to do the special cases that are left.
+        */
+       preload_index(istate, pathspec, 0);
        for (i = 0; i < istate->cache_nr; i++) {
                struct cache_entry *ce, *new_entry;
                int cache_errno = 0;