t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 12 Nov 2018 13:48:36 +0000 (05:48 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Nov 2018 04:50:21 +0000 (13:50 +0900)
It makes very, very little sense to test the built git-sh-i18n when the
user asked specifically to test another one.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-gettext.sh
index eec757f104708df3a00935cef89dd7dad537afb9..9eb160c997a0f4ccaf277d8c8daa655179d18b34 100644 (file)
@@ -10,7 +10,12 @@ GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
 GIT_PO_PATH="$GIT_BUILD_DIR/po"
 export GIT_TEXTDOMAINDIR GIT_PO_PATH
 
-. "$GIT_BUILD_DIR"/git-sh-i18n
+if test -n "$GIT_TEST_INSTALLED"
+then
+       . "$(git --exec-path)"/git-sh-i18n
+else
+       . "$GIT_BUILD_DIR"/git-sh-i18n
+fi
 
 if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON
 then