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 <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Torsten Bögershausen committed
Jun 20, 2013 at 16:58 UTC
bed947048919d0ed8b8eece38eb18b15f99e313f
1 file changed
+11
-8
t/t7400-submodule-basic.sh
+11
-8
@@ -868,16 +868,19 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory
868
test -n "$(git config --get-regexp "submodule\.example\.")"
869
'
870
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" &&
874
(
874
- cd "å äö" &&
875
+ cd "$svname" &&
876
git init &&
876
- touch sub
877
- git add sub
877
+ >sub &&
878
+ git add sub &&
879
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")"
885
'
886
test_done