diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2019-05-07 13:10:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-08 11:58:12 +0900 |
commit | dc76852df2f7bc5a6c79a796954a81f5af284c34 (patch) | |
tree | d225fca4d2059c8b39509f2b31f5bd9d20a0def1 /t/t5100 | |
parent | mingw: allow building with an MSYS2 runtime v3.x (diff) | |
download | tgif-dc76852df2f7bc5a6c79a796954a81f5af284c34.tar.xz |
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 't/t5100')
0 files changed, 0 insertions, 0 deletions