diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-03-25 16:05:52 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-03-25 16:05:52 -0700 |
| commit | 852e2c84f847d99e29fd08feb8cea881dca63c79 (patch) | |
| tree | 20190f12233f00373df4760c8ddb300f848d19d4 /read-cache.c | |
| parent | 45fe28c951c3e70666ee4ef8379772851a8e4d32 (diff) | |
| parent | a3dfe97f418762ccf1d0601c5cce40c77046d4fc (diff) | |
| download | git-852e2c84f847d99e29fd08feb8cea881dca63c79.tar.xz | |
Merge branch 'jh/builtin-fsmonitor-part2' into jh/builtin-fsmonitor-part3
* jh/builtin-fsmonitor-part2: (150 commits)
t7527: test status with untracked-cache and fsmonitor--daemon
fsmonitor: force update index after large responses
fsmonitor--daemon: use a cookie file to sync with file system
fsmonitor--daemon: periodically truncate list of modified files
t/perf/p7519: add fsmonitor--daemon test cases
t/perf/p7519: speed up test on Windows
t/perf/p7519: fix coding style
t/helper/test-chmtime: skip directories on Windows
t/perf: avoid copying builtin fsmonitor files into test repo
t7527: create test for fsmonitor--daemon
t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon
help: include fsmonitor--daemon feature flag in version info
fsmonitor--daemon: implement handle_client callback
compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS
compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent
compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Windows
fsmonitor--daemon: create token-based changed path cache
fsmonitor--daemon: define token-ids
fsmonitor--daemon: add pathname classification
fsmonitor--daemon: implement 'start' command
...
Diffstat (limited to 'read-cache.c')
| -rw-r--r-- | read-cache.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c index 63a792e578..79b9b99ebf 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1340,9 +1340,6 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e int skip_df_check = option & ADD_CACHE_SKIP_DFCHECK; int new_only = option & ADD_CACHE_NEW_ONLY; - if (!(option & ADD_CACHE_KEEP_CACHE_TREE)) - cache_tree_invalidate_path(istate, ce->name); - /* * If this entry's path sorts after the last entry in the index, * we can avoid searching for it. @@ -1353,6 +1350,13 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e else pos = index_name_stage_pos(istate, ce->name, ce_namelen(ce), ce_stage(ce), EXPAND_SPARSE); + /* + * Cache tree path should be invalidated only after index_name_stage_pos, + * in case it expands a sparse index. + */ + if (!(option & ADD_CACHE_KEEP_CACHE_TREE)) + cache_tree_invalidate_path(istate, ce->name); + /* existing match? Just replace it. */ if (pos >= 0) { if (!new_only) |
