Skip to content

Commit bed9470

Browse files
tboegigitster
authored andcommitted
t7400: test of UTF-8 submodule names pass under Mac OS
submodules with names using UTF-8 need core.precomposeunicode true under Mac OS X, set it in the test case. Improve the portability: - Not all shells on all OS may understand literal UTF-8 strings. - Use a help variable filled by printf, as we do it in e.g. t0050. "strange names" can be called UTF-8, rephrase the heading. While at it, unbreak &&-chain in the test, and use test_config. Signed-off-by: Torsten Bögershausen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7467124 commit bed9470

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

t/t7400-submodule-basic.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -868,16 +868,19 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory
868868
test -n "$(git config --get-regexp "submodule\.example\.")"
869869
'
870870

871-
test_expect_success 'submodule with strange name works "å äö"' '
872-
mkdir "å äö" &&
871+
test_expect_success 'submodule with UTF-8 name' '
872+
svname=$(printf "\303\245 \303\244\303\266") &&
873+
mkdir "$svname" &&
873874
(
874-
cd "å äö" &&
875+
cd "$svname" &&
875876
git init &&
876-
touch sub
877-
git add sub
877+
>sub &&
878+
git add sub &&
878879
git commit -m "init sub"
879-
)
880-
git submodule add "/å äö" &&
881-
test -n "$(git submodule | grep "å äö")"
880+
) &&
881+
test_config core.precomposeunicode true &&
882+
git submodule add ./"$svname" &&
883+
git submodule >&2 &&
884+
test -n "$(git submodule | grep "$svname")"
882885
'
883886
test_done

0 commit comments

Comments
 (0)