]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7527: test FSMonitor on repos with Unicode root paths
authorJeff Hostetler <jeffhost@microsoft.com>
Thu, 26 May 2022 21:46:56 +0000 (21:46 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2022 22:59:25 +0000 (15:59 -0700)
Create some test repos with UTF8 characters in the pathname of the
root directory and verify that the builtin FSMonitor can watch them.

This test is mainly for Windows where we need to avoid `*A()`
routines.

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

index 1be21785162d0b235515898209858a89a9285f63..12655958e719281685bf854ffebfd4ab31bafbb7 100755 (executable)
@@ -671,4 +671,27 @@ do
        done
 done
 
+# Test Unicode UTF-8 characters in the pathname of the working
+# directory root.  Use of "*A()" routines rather than "*W()" routines
+# on Windows can sometimes lead to odd failures.
+#
+u1=$(printf "u_c3_a6__\xC3\xA6")
+u2=$(printf "u_e2_99_ab__\xE2\x99\xAB")
+u_values="$u1 $u2"
+for u in $u_values
+do
+       test_expect_success "unicode in repo root path: $u" '
+               test_when_finished "stop_daemon_delete_repo $u" &&
+
+               git init "$u" &&
+               echo 1 >"$u"/file1 &&
+               git -C "$u" add file1 &&
+               git -C "$u" config core.fsmonitor true &&
+
+               start_daemon -C "$u" &&
+               git -C "$u" status >actual &&
+               grep "new file:   file1" actual
+       '
+done
+
 test_done