Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Peart <benpeart@microsoft.com>2018-04-10 21:14:31 +0300
committerJunio C Hamano <gitster@pobox.com>2018-04-11 12:09:48 +0300
commitca598d5f2ab988935a5b882b44122cbfa5fd99f5 (patch)
treec84b5e041c1f1e6cd17be8451b6db8a0fce2498a /fsmonitor.c
parent8b026edac3104ecc40a68fd58b764fb3c717babb (diff)
fsmonitor: force index write after full scan
fsmonitor currently only flags the index as dirty if the extension is being added or removed. This is a performance optimization that recognizes you can stat() a lot of files in less time than it takes to write out an updated index. This patch makes a small enhancement and flags the index dirty if we end up having to stat() all files and scan the entire working directory. The assumption being that must be expensive or you would not have turned on the feature. Signed-off-by: Ben Peart <benpeart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsmonitor.c')
-rw-r--r--fsmonitor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fsmonitor.c b/fsmonitor.c
index 6d7bcd5d0e..2b4d3bb0a2 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -185,6 +185,9 @@ void refresh_fsmonitor(struct index_state *istate)
for (i = 0; i < istate->cache_nr; i++)
istate->cache[i]->ce_flags &= ~CE_FSMONITOR_VALID;
+ /* If we're going to check every file, ensure we save the results */
+ istate->cache_changed |= FSMONITOR_CHANGED;
+
if (istate->untracked)
istate->untracked->use_fsmonitor = 0;
}