Skip to content

Commit f159bdd

Browse files
committed
Merge branch 'jc/t9129-any-utf8'
* jc/t9129-any-utf8: t9129: fix UTF-8 locale detection
2 parents 8b8063c + 2de03eb commit f159bdd

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

t/t9129-git-svn-i18n-commitencoding.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,22 @@ compare_git_head_with () {
1414
test_cmp current "$1"
1515
}
1616

17+
a_utf8_locale=$(locale -a | sed -n '/\.[uU][tT][fF]-*8$/{
18+
p
19+
q
20+
}')
21+
22+
if test -n "$a_utf8_locale"
23+
then
24+
test_set_prereq UTF8
25+
else
26+
say "UTF-8 locale not available, some tests are skipped"
27+
fi
28+
1729
compare_svn_head_with () {
1830
# extract just the log message and strip out committer info.
1931
# don't use --limit here since svn 1.1.x doesn't have it,
20-
LC_ALL=en_US.UTF-8 svn log `git svn info --url` | perl -w -e '
32+
LC_ALL="$a_utf8_locale" svn log `git svn info --url` | perl -w -e '
2133
use bytes;
2234
$/ = ("-"x72) . "\n";
2335
my @x = <STDIN>;
@@ -69,12 +81,6 @@ do
6981
'
7082
done
7183

72-
if locale -a |grep -q en_US.utf8; then
73-
test_set_prereq UTF8
74-
else
75-
say "UTF-8 locale not available, test skipped"
76-
fi
77-
7884
test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' '
7985
(
8086
cd ISO8859-1 &&

0 commit comments

Comments
 (0)