summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-05-07 11:10:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-08 03:03:48 (GMT)
commit398a3b0899dd8a440d4adbcbda38362e3f8359b1 (patch)
treee4231bcbe6bc2fa30593292cb34cabf863d7cbf7 /cache.h
parentdc76852df2f7bc5a6c79a796954a81f5af284c34 (diff)
downloadgit-398a3b0899dd8a440d4adbcbda38362e3f8359b1.zip
git-398a3b0899dd8a440d4adbcbda38362e3f8359b1.tar.gz
git-398a3b0899dd8a440d4adbcbda38362e3f8359b1.tar.bz2
fsmonitor: force a refresh after the index was discarded
With this change, the `index_state` struct becomes the new home for the flag that says whether the fsmonitor hook has been run, i.e. it is now per-index. It also gets re-set when the index is discarded, fixing the bug demonstrated by the "test_expect_failure" test added in the preceding commit. In that case fsmonitor-enabled Git would miss updates under certain circumstances, see that preceding commit for details. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 27fe635..06ca755 100644
--- a/cache.h
+++ b/cache.h
@@ -338,7 +338,8 @@ struct index_state {
struct cache_time timestamp;
unsigned name_hash_initialized : 1,
initialized : 1,
- drop_cache_tree : 1;
+ drop_cache_tree : 1,
+ fsmonitor_has_run_once : 1;
struct hashmap name_hash;
struct hashmap dir_hash;
struct object_id oid;