path: root/t/
diff options
authorĐoàn Trần Công Danh <>2021-06-08 06:56:28 (GMT)
committerJunio C Hamano <>2021-06-08 07:07:37 (GMT)
commit482c962de4af32471a5ab770160731a028fcd9d6 (patch)
tree528c6dea32da508397e8d87b2c771aa15c40c3f6 /t/
parent48bf2fa8bad054d66bd79c6ba903c89c704201f7 (diff)
t: use user-specified utf-8 locale for testing svn
In some test-cases, UTF-8 locale is required. To find such locale, we're using the first available UTF-8 locale that returned by "locale -a". However, the locale(1) utility is unavailable on some systems, e.g. Linux with musl libc. However, without "locale -a", we can't guess provided UTF-8 locale. Add a Makefile knob GIT_TEST_UTF8_LOCALE and activate it for linux-musl in our CI system. Rename t/ to prepare_utf8_locale, since we no longer prepare the variable named "a_utf8_locale", but set up a fallback value for GIT_TEST_UTF8_LOCALE instead. The fallback will be LC_ALL, LANG environment variable, or the first UTF-8 locale from output of "locale -a", in that order. Signed-off-by: Đoàn Trần Công Danh <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 3 insertions, 11 deletions
diff --git a/t/ b/t/
index 1d3fdcc..d5563ec 100755
--- a/t/
+++ b/t/
@@ -4,21 +4,13 @@
test_description='git svn basic tests'
. ./
-case "$GIT_SVN_LC_ALL" in
- test_set_prereq UTF8
- ;;
- say "# UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)"
- ;;
test_expect_success 'git svn --version works anywhere' '
nongit git svn --version
@@ -187,8 +179,8 @@ test_expect_success POSIXPERM,SYMLINKS "$name" '
test ! -h "$SVN_TREE"/ &&
test_cmp help "$SVN_TREE"/'
-name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
+name="commit with UTF-8 message: locale: $GIT_TEST_UTF8_LOCALE"
export LC_ALL
# This test relies on the previous test, hence requires POSIXPERM,SYMLINKS
test_expect_success UTF8,POSIXPERM,SYMLINKS "$name" "