Skip to content

Commit 69df7c5

Browse files
jeffhostetlerGit for Windows Build Agent
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]>
1 parent 44878b4 commit 69df7c5

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
@@ -814,4 +814,40 @@ test_expect_success "Submodule" '
814814
my_match_and_clean
815815
'
816816

817+
# On a case-insensitive file system, confirm that the daemon
818+
# notices when the .git directory is moved/renamed/deleted
819+
# regardless of how it is spelled in the the FS event.
820+
# That is, does the FS event receive the spelling of the
821+
# operation or does it receive the spelling preserved with
822+
# the file/directory.
823+
#
824+
test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
825+
# test_when_finished "stop_daemon_delete_repo test_insensitive" &&
826+
827+
git init test_insensitive &&
828+
829+
start_daemon -C test_insensitive --tf "$PWD/insensitive.trace" &&
830+
831+
mkdir -p test_insensitive/abc/def &&
832+
echo xyz >test_insensitive/ABC/DEF/xyz &&
833+
834+
test_path_is_dir test_insensitive/.git &&
835+
test_path_is_dir test_insensitive/.GIT &&
836+
837+
# Rename .git using an alternate spelling to verify that that
838+
# daemon detects it and automatically shuts down.
839+
mv test_insensitive/.GIT test_insensitive/.FOO &&
840+
sleep 1 &&
841+
mv test_insensitive/.FOO test_insensitive/.git &&
842+
test_must_fail git -C test_insensitive fsmonitor--daemon status &&
843+
844+
# Verify that events were reported using on-disk spellings of the
845+
# directories and files that we touched. We may or may not get a
846+
# trailing slash on modified directories.
847+
#
848+
egrep "^event: abc/?$" ./insensitive.trace &&
849+
egrep "^event: abc/def/?$" ./insensitive.trace &&
850+
egrep "^event: abc/def/xyz$" ./insensitive.trace
851+
'
852+
817853
test_done

0 commit comments

Comments
 (0)