From 74671241fd53df2899d4b4400593afc12e8e1bf7 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Fri, 14 Jun 2013 02:26:02 +0200 Subject: handle multibyte characters in name Many "git submodule" operations do not work on a submodule at a path whose name is not in ASCII. This is because "git ls-files" is used to find which paths are bound to submodules to the current working tree, and the output is C-quoted by default for non ASCII pathnames. Tell "git ls-files" to not C-quote its output, which is easier than unwrapping C-quote ourselves. Signed-off-by: Fredrik Gustafsson Signed-off-by: Junio C Hamano --- t/t7400-submodule-basic.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't') diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index ff265353a3..d5743eeb4c 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -868,4 +868,16 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory test -n "$(git config --get-regexp "submodule\.example\.")" ' +test_expect_success 'submodule with strange name works "å äö"' ' + mkdir "å äö" && + ( + cd "å äö" && + git init && + touch sub + git add sub + git commit -m "init sub" + ) + git submodule add "/å äö" && + test -n "$(git submodule | grep "å äö")" +' test_done -- cgit v1.2.3 From bed947048919d0ed8b8eece38eb18b15f99e313f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Thu, 20 Jun 2013 16:58:48 +0200 Subject: t7400: test of UTF-8 submodule names pass under Mac OS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- t/t7400-submodule-basic.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 't') diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index d5743eeb4c..7e23421309 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -868,16 +868,19 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory test -n "$(git config --get-regexp "submodule\.example\.")" ' -test_expect_success 'submodule with strange name works "å äö"' ' - mkdir "å äö" && +test_expect_success 'submodule with UTF-8 name' ' + svname=$(printf "\303\245 \303\244\303\266") && + mkdir "$svname" && ( - cd "å äö" && + cd "$svname" && git init && - touch sub - git add sub + >sub && + git add sub && git commit -m "init sub" - ) - git submodule add "/å äö" && - test -n "$(git submodule | grep "å äö")" + ) && + test_config core.precomposeunicode true && + git submodule add ./"$svname" && + git submodule >&2 && + test -n "$(git submodule | grep "$svname")" ' test_done -- cgit v1.2.3