Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2022-05-27 00:47:18 +0300
committerJunio C Hamano <gitster@pobox.com>2022-05-27 01:59:27 +0300
commitcaa9c37ec0b1c30ac1df266d01da6edb2c49d8ad (patch)
tree3768817ba132328d58cd3d9bdf932e902b2b6fd3 /t/t7527-builtin-fsmonitor.sh
parentf954c7b8ff3f1443dfd52b5d0c59208a8d1d87ec (diff)
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 <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7527-builtin-fsmonitor.sh')
-rwxr-xr-xt/t7527-builtin-fsmonitor.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh
index cf4fb72c3f..fbb7d6aef6 100755
--- a/t/t7527-builtin-fsmonitor.sh
+++ b/t/t7527-builtin-fsmonitor.sh
@@ -832,4 +832,40 @@ test_expect_success 'submodule always visited' '
my_match_and_clean
'
+# On a case-insensitive file system, confirm that the daemon
+# notices when the .git directory is moved/renamed/deleted
+# regardless of how it is spelled in the the FS event.
+# That is, does the FS event receive the spelling of the
+# operation or does it receive the spelling preserved with
+# the file/directory.
+#
+test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
+# test_when_finished "stop_daemon_delete_repo test_insensitive" &&
+
+ git init test_insensitive &&
+
+ start_daemon -C test_insensitive --tf "$PWD/insensitive.trace" &&
+
+ mkdir -p test_insensitive/abc/def &&
+ echo xyz >test_insensitive/ABC/DEF/xyz &&
+
+ test_path_is_dir test_insensitive/.git &&
+ test_path_is_dir test_insensitive/.GIT &&
+
+ # Rename .git using an alternate spelling to verify that that
+ # daemon detects it and automatically shuts down.
+ mv test_insensitive/.GIT test_insensitive/.FOO &&
+ sleep 1 &&
+ mv test_insensitive/.FOO test_insensitive/.git &&
+ test_must_fail git -C test_insensitive fsmonitor--daemon status &&
+
+ # Verify that events were reported using on-disk spellings of the
+ # directories and files that we touched. We may or may not get a
+ # trailing slash on modified directories.
+ #
+ egrep "^event: abc/?$" ./insensitive.trace &&
+ egrep "^event: abc/def/?$" ./insensitive.trace &&
+ egrep "^event: abc/def/xyz$" ./insensitive.trace
+'
+
test_done