diff options
author | Ben Peart <benpeart@microsoft.com> | 2018-02-05 14:56:19 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-05 12:55:49 -0800 |
commit | fc9ecbeb93d3c4fae2439e1d9c5346052a1796c2 (patch) | |
tree | 4bef947d11e0b7c48fff4f08a2323a26a687ec06 /t/t7063-status-untracked-cache.sh | |
parent | 5be1f00a9a701532232f57958efab4be8c959a29 (diff) | |
download | git-fc9ecbeb93d3c4fae2439e1d9c5346052a1796c2.tar.gz |
dir.c: don't flag the index as dirty for changes to the untracked cache
The untracked cache saves its current state in the UNTR index extension.
Currently, _any_ change to that state causes the index to be flagged as dirty
and written out to disk. Unfortunately, the cost to write out the index can
exceed the savings gained by using the untracked cache. Since it is a cache
that can be updated from the current state of the working directory, there is
no functional requirement that the index be written out for every change to the
untracked cache.
Update the untracked cache logic so that it no longer forces the index to be
written to disk except in the case where the extension is being turned on or
off. When some other git command requires the index to be written to disk, the
untracked cache will take advantage of that to save it's updated state as well.
This results in a performance win when looked at over common sequences of git
commands (ie such as a status followed by add, commit, etc).
After this patch, all the logic to track statistics for the untracked cache
could be removed as it is only used by debug tracing used to debug the untracked
cache.
Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7063-status-untracked-cache.sh')
-rwxr-xr-x | t/t7063-status-untracked-cache.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh index e5fb892f95..6ef520e823 100755 --- a/t/t7063-status-untracked-cache.sh +++ b/t/t7063-status-untracked-cache.sh @@ -14,6 +14,9 @@ test_description='test untracked cache' # See <20160803174522.5571-1-pclouds@gmail.com> if you want to know # more. +GIT_TEST_UNTRACKED_CACHE=true +export GIT_TEST_UNTRACKED_CACHE + sync_mtime () { find . -type d -ls >/dev/null } |