]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'bp/untracked-cache-noflush'
authorJunio C Hamano <gitster@pobox.com>
Thu, 8 Mar 2018 20:36:30 +0000 (12:36 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Mar 2018 20:36:30 +0000 (12:36 -0800)
Writing out the index file when the only thing that changed in it
is the untracked cache information is often wasteful, and this has
been optimized out.

* bp/untracked-cache-noflush:
  untracked cache: use git_env_bool() not getenv() for customization
  dir.c: don't flag the index as dirty for changes to the untracked cache

1  2 
dir.c
t/t7063-status-untracked-cache.sh

diff --cc dir.c
index 6dd91be8185d4012e11495a9238636913fedeeef,d445d77e626e84a56d44c73f0cf4118fc4f19600..dedbf5d476f207e39c1b7853ec8c97553181e5fb
--- 1/dir.c
--- 2/dir.c
+++ b/dir.c
@@@ -2295,9 -2291,13 +2300,14 @@@ int read_directory(struct dir_struct *d
                dir->nr = i;
        }
  
 +      trace_performance_since(start, "read directory %.*s", len, path);
        if (dir->untracked) {
+               static int force_untracked_cache = -1;
                static struct trace_key trace_untracked_stats = TRACE_KEY_INIT(UNTRACKED_STATS);
+               if (force_untracked_cache < 0)
+                       force_untracked_cache =
+                               git_env_bool("GIT_FORCE_UNTRACKED_CACHE", 0);
                trace_printf_key(&trace_untracked_stats,
                                 "node creation: %u\n"
                                 "gitignore invalidation: %u\n"
Simple merge