Skip to content

Commit caa9c37

Browse files
jeffhostetlergitster
authored andcommitted
t7527: test FSMonitor on case insensitive+preserving file system
Test that FS events from the OS are received using the preserved, on-disk spelling of files/directories rather than spelling used to make the change. Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f954c7b commit caa9c37

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

t/t7527-builtin-fsmonitor.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,4 +832,40 @@ test_expect_success 'submodule always visited' '
832832
my_match_and_clean
833833
'
834834

835+
# On a case-insensitive file system, confirm that the daemon
836+
# notices when the .git directory is moved/renamed/deleted
837+
# regardless of how it is spelled in the the FS event.
838+
# That is, does the FS event receive the spelling of the
839+
# operation or does it receive the spelling preserved with
840+
# the file/directory.
841+
#
842+
test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
843+
# test_when_finished "stop_daemon_delete_repo test_insensitive" &&
844+
845+
git init test_insensitive &&
846+
847+
start_daemon -C test_insensitive --tf "$PWD/insensitive.trace" &&
848+
849+
mkdir -p test_insensitive/abc/def &&
850+
echo xyz >test_insensitive/ABC/DEF/xyz &&
851+
852+
test_path_is_dir test_insensitive/.git &&
853+
test_path_is_dir test_insensitive/.GIT &&
854+
855+
# Rename .git using an alternate spelling to verify that that
856+
# daemon detects it and automatically shuts down.
857+
mv test_insensitive/.GIT test_insensitive/.FOO &&
858+
sleep 1 &&
859+
mv test_insensitive/.FOO test_insensitive/.git &&
860+
test_must_fail git -C test_insensitive fsmonitor--daemon status &&
861+
862+
# Verify that events were reported using on-disk spellings of the
863+
# directories and files that we touched. We may or may not get a
864+
# trailing slash on modified directories.
865+
#
866+
egrep "^event: abc/?$" ./insensitive.trace &&
867+
egrep "^event: abc/def/?$" ./insensitive.trace &&
868+
egrep "^event: abc/def/xyz$" ./insensitive.trace
869+
'
870+
835871
test_done

0 commit comments

Comments
 (0)