Merge branch 'dd/svn-test-wo-locale-a'
"git-svn" tests assumed that "locale -a", which is used to pick an available UTF-8 locale, is available everywhere. A knob has been introduced to allow testers to specify a suitable locale to use. * dd/svn-test-wo-locale-a: t: use user-specified utf-8 locale for testing svn
This commit is contained in:
@ -121,12 +121,22 @@ start_svnserve () {
|
||||
--listen-host 127.0.0.1 &
|
||||
}
|
||||
|
||||
prepare_a_utf8_locale () {
|
||||
a_utf8_locale=$(locale -a | sed -n '/\.[uU][tT][fF]-*8$/{
|
||||
p
|
||||
q
|
||||
}')
|
||||
if test -n "$a_utf8_locale"
|
||||
prepare_utf8_locale () {
|
||||
if test -z "$GIT_TEST_UTF8_LOCALE"
|
||||
then
|
||||
case "${LC_ALL:-$LANG}" in
|
||||
*.[Uu][Tt][Ff]8 | *.[Uu][Tt][Ff]-8)
|
||||
GIT_TEST_UTF8_LOCALE="${LC_ALL:-$LANG}"
|
||||
;;
|
||||
*)
|
||||
GIT_TEST_UTF8_LOCALE=$(locale -a | sed -n '/\.[uU][tT][fF]-*8$/{
|
||||
p
|
||||
q
|
||||
}')
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test -n "$GIT_TEST_UTF8_LOCALE"
|
||||
then
|
||||
test_set_prereq UTF8
|
||||
else
|
||||
|
@ -4,21 +4,13 @@
|
||||
#
|
||||
|
||||
test_description='git svn basic tests'
|
||||
GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
|
||||
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
. ./lib-git-svn.sh
|
||||
|
||||
case "$GIT_SVN_LC_ALL" in
|
||||
*.UTF-8)
|
||||
test_set_prereq UTF8
|
||||
;;
|
||||
*)
|
||||
say "# UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)"
|
||||
;;
|
||||
esac
|
||||
prepare_utf8_locale
|
||||
|
||||
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"/exec-2.sh &&
|
||||
test_cmp help "$SVN_TREE"/exec-2.sh'
|
||||
|
||||
name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
|
||||
LC_ALL="$GIT_SVN_LC_ALL"
|
||||
name="commit with UTF-8 message: locale: $GIT_TEST_UTF8_LOCALE"
|
||||
LC_ALL="$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" "
|
||||
|
@ -93,9 +93,9 @@ test_expect_success 'git svn rebase works inside a fresh-cloned repository' '
|
||||
# > ... All of the above characters, except for the backslash, are converted
|
||||
# > to special UNICODE characters in the range 0xf000 to 0xf0ff (the
|
||||
# > "Private use area") when creating or accessing files.
|
||||
prepare_a_utf8_locale
|
||||
prepare_utf8_locale
|
||||
test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 new file on dcommit' '
|
||||
LC_ALL=$a_utf8_locale &&
|
||||
LC_ALL=$GIT_TEST_UTF8_LOCALE &&
|
||||
export LC_ALL &&
|
||||
neq=$(printf "\201\202") &&
|
||||
git config svn.pathnameencoding cp932 &&
|
||||
@ -107,7 +107,7 @@ test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 new
|
||||
|
||||
# See the comment on the above test for setting of LC_ALL.
|
||||
test_expect_success !MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 rename on dcommit' '
|
||||
LC_ALL=$a_utf8_locale &&
|
||||
LC_ALL=$GIT_TEST_UTF8_LOCALE &&
|
||||
export LC_ALL &&
|
||||
inf=$(printf "\201\207") &&
|
||||
git config svn.pathnameencoding cp932 &&
|
||||
|
@ -14,12 +14,12 @@ compare_git_head_with () {
|
||||
test_cmp current "$1"
|
||||
}
|
||||
|
||||
prepare_a_utf8_locale
|
||||
prepare_utf8_locale
|
||||
|
||||
compare_svn_head_with () {
|
||||
# extract just the log message and strip out committer info.
|
||||
# don't use --limit here since svn 1.1.x doesn't have it,
|
||||
LC_ALL="$a_utf8_locale" svn log $(git svn info --url) | perl -w -e '
|
||||
LC_ALL="$GIT_TEST_UTF8_LOCALE" svn log $(git svn info --url) | perl -w -e '
|
||||
use bytes;
|
||||
$/ = ("-"x72) . "\n";
|
||||
my @x = <STDIN>;
|
||||
|
Reference in New Issue
Block a user