* [PATCH] t7400: test of UTF-8 submodule names pass under Mac OS
@ 2013-06-20 14:58 Torsten Bögershausen
2013-06-20 19:01 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Torsten Bögershausen @ 2013-06-20 14:58 UTC (permalink / raw)
To: git, tboegi; +Cc: iveqy
submodules with names using UTF-8 need core.precomposeunicode true
under Mac OS X, set it in the TC.
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
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
I wasn't fast enough to catch it on pu:
fg/submodule-non-ascii-path
t/t7400-submodule-basic.sh | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 0376370..fedfa5b 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -889,16 +889,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 "å äö" &&
+svname=$(printf '\303\245 \303\244\303\266')
+test_expect_success 'submodule with UTF-8 name' '
+ mkdir "$svname" &&
(
- cd "å äö" &&
+ cd "$svname" &&
git init &&
touch sub
git add sub
git commit -m "init sub"
)
- git submodule add "/å äö" &&
- test -n "$(git submodule | grep "å äö")"
+ git config core.precomposeunicode true &&
+ git submodule add /"$svname" &&
+ git submodule >&2 &&
+ test -n "$(git submodule | grep "$svname")"
'
test_done
--
1.8.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] t7400: test of UTF-8 submodule names pass under Mac OS
2013-06-20 14:58 [PATCH] t7400: test of UTF-8 submodule names pass under Mac OS Torsten Bögershausen
@ 2013-06-20 19:01 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2013-06-20 19:01 UTC (permalink / raw)
To: Torsten Bögershausen; +Cc: git, iveqy
Torsten Bögershausen <tboegi@web.de> writes:
> submodules with names using UTF-8 need core.precomposeunicode true
> under Mac OS X, set it in the TC.
I take that TC stands for test case?
> +test_expect_success 'submodule with UTF-8 name' '
> + mkdir "$svname" &&
> (
> - cd "å äö" &&
> + cd "$svname" &&
> git init &&
> touch sub
> git add sub
> git commit -m "init sub"
> )
While we are at it, let's fix this broken && chain.
> - git submodule add "/å äö" &&
> - test -n "$(git submodule | grep "å äö")"
> + git config core.precomposeunicode true &&
and use test_config here.
> + git submodule add /"$svname" &&
> + git submodule >&2 &&
> + test -n "$(git submodule | grep "$svname")"
> '
> test_done
Will queue with an obvious fix-up. Thanks for catching.
-- >8 --
From: Torsten Bögershausen <tboegi@web.de>
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>
---
t/t7400-submodule-basic.sh | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index d5743ee..7e23421 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
--
1.8.3.1-674-g24fae08
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-20 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-20 14:58 [PATCH] t7400: test of UTF-8 submodule names pass under Mac OS Torsten Bögershausen
2013-06-20 19:01 ` Junio C Hamano
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).