summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-19 07:24:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-19 07:24:39 (GMT)
commit954932667dac15885165cdb579acbf6a774fe140 (patch)
tree73d9e230929da6c9ffcb17ac6a52516a7ff32e3f /t/test-lib.sh
parent0e94dab5be2fd17cfba634f8a29ba5461d2cbd9e (diff)
parentc6a9a30e6a01b4d5329d796b800ab0917b963b20 (diff)
downloadgit-954932667dac15885165cdb579acbf6a774fe140.zip
git-954932667dac15885165cdb579acbf6a774fe140.tar.gz
git-954932667dac15885165cdb579acbf6a774fe140.tar.bz2
Merge branch 'ab/dynamic-gettext-poison'
Our testing framework uses a special i18n "poisoned localization" feature to find messages that ought to stay constant but are incorrectly marked to be translated. This feature has been made into a runtime option (it used to be a compile-time option). * ab/dynamic-gettext-poison: Makefile: ease dynamic-gettext-poison transition i18n: make GETTEXT_POISON a runtime option
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index aba66ca..219ca1d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -95,6 +95,16 @@ PAGER=cat
TZ=UTC
export LANG LC_ALL PAGER TZ
EDITOR=:
+
+# GIT_TEST_GETTEXT_POISON should not influence git commands executed
+# during initialization of test-lib and the test repo. Back it up,
+# unset and then restore after initialization is finished.
+if test -n "$GIT_TEST_GETTEXT_POISON"
+then
+ GIT_TEST_GETTEXT_POISON_ORIG=$GIT_TEST_GETTEXT_POISON
+ unset GIT_TEST_GETTEXT_POISON
+fi
+
# A call to "unset" with no arguments causes at least Solaris 10
# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
# deriving from the command substitution clustered with the other
@@ -1104,13 +1114,15 @@ test -n "$USE_LIBPCRE1" && test_set_prereq LIBPCRE1
test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
+if test -n "$GIT_TEST_GETTEXT_POISON_ORIG"
+then
+ GIT_TEST_GETTEXT_POISON=$GIT_TEST_GETTEXT_POISON_ORIG
+ unset GIT_TEST_GETTEXT_POISON_ORIG
+fi
+
# Can we rely on git's output in the C locale?
-if test -n "$GETTEXT_POISON"
+if test -z "$GIT_TEST_GETTEXT_POISON"
then
- GIT_GETTEXT_POISON=YesPlease
- export GIT_GETTEXT_POISON
- test_set_prereq GETTEXT_POISON
-else
test_set_prereq C_LOCALE_OUTPUT
fi