diff mbox series

[v7,02/30] t7527: test FSMonitor on repos with Unicode root paths

Message ID 1bf2e36b6adb127dd1654bba0b6ba84f626535a0.1653336765.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit 27b5d4171d90073e37c7c1233b6bcc95ba58ae1d
Headers show
Series Builtin FSMonitor Part 3 | expand

Commit Message

Jeff Hostetler May 23, 2022, 8:12 p.m. UTC
From: Jeff Hostetler <jeffhost@microsoft.com>

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()`

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
 t/t7527-builtin-fsmonitor.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff mbox series


diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh
index 1be21785162..12655958e71 100755
--- a/t/t7527-builtin-fsmonitor.sh
+++ b/t/t7527-builtin-fsmonitor.sh
@@ -671,4 +671,27 @@  do
+# 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
+	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
+	'