]> git.ipfire.org Git - thirdparty/git.git/commit
t7527: add case-insensitve test for FSMonitor
authorJeff Hostetler <jeffhostetler@github.com>
Mon, 26 Feb 2024 21:39:13 +0000 (21:39 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Feb 2024 23:34:01 +0000 (15:34 -0800)
commit32ca706fadb947e7cb461f4c9780ccd233ef93d9
tree0f00cdb5969e93d64815929562fd67055afa2a10
parentb3165523394a3ad4ede8872b984bbc644b056cdc
t7527: add case-insensitve test for FSMonitor

The FSMonitor client code trusts the spelling of the pathnames in the
FSEvents received from the FSMonitor daemon.  On case-insensitive file
systems, these OBSERVED pathnames may be spelled differently than the
EXPECTED pathnames listed in the .git/index.  This causes a miss when
using `index_name_pos()` which expects the given case to be correct.

When this happens, the FSMonitor client code does not update the state
of the CE_FSMONITOR_VALID bit when refreshing the index (and before
starting to scan the worktree).

This results in modified files NOT being reported by `git status` when
there is a discrepancy in the case-spelling of a tracked file's
pathname.

This commit contains a (rather contrived) test case to demonstrate
this.  A later commit in this series will update the FSMonitor client
code to recognize these discrepancies and update the CE_ bit accordingly.

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7527-builtin-fsmonitor.sh