summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-05-07 11:10:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-08 02:58:12 (GMT)
commitdc76852df2f7bc5a6c79a796954a81f5af284c34 (patch)
treed225fca4d2059c8b39509f2b31f5bd9d20a0def1 /read-cache.c
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
downloadgit-dc76852df2f7bc5a6c79a796954a81f5af284c34.zip
git-dc76852df2f7bc5a6c79a796954a81f5af284c34.tar.gz
git-dc76852df2f7bc5a6c79a796954a81f5af284c34.tar.bz2
fsmonitor: demonstrate that it is not refreshed after discard_index()
This one is tricky. When `core.fsmonitor` is set, a `refresh_index()` will not perform a full scan of files that might be modified, but will query the fsmonitor and refresh only the ones that have been actually touched. Due to implementation details, the fsmonitor is queried in `refresh_cache_ent()`, but of course it only has to be queried once, so we set a flag when we did that. But when the index was discarded, we did not re-set that flag. So far, this is only covered by our test suite when running with GIT_TEST_FSMONITOR=$PWD/t7519/fsmonitor-all, and only due to the way the built-in stash interacts with the recursive merge machinery. Let's introduce a straight-forward regression test for this. We simply extend the "read & discard index" loop in `test-tool read-cache` to optionally refresh the index, report on a given file's status, and then modify that file. Due to the bug described above, only the first refresh will actually query the fsmonitor; subsequent loop iterations will not. This problem was reported by Ævar Arnfjörð Bjarmason. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
0 files changed, 0 insertions, 0 deletions