summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-03-02 18:48:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-03-02 22:41:06 (GMT)
commit661bfd13b49db0affebbdda5ac478ebe67634947 (patch)
treee09ad288cc8b942bf96f2b8b6983928aeab7484a /t/test-lib.sh
parent70eb130768d17c33b9efbf60d7953cf6a57daecb (diff)
downloadgit-661bfd13b49db0affebbdda5ac478ebe67634947.zip
git-661bfd13b49db0affebbdda5ac478ebe67634947.tar.gz
git-661bfd13b49db0affebbdda5ac478ebe67634947.tar.bz2
tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh
If any test script is run directly with Solaris 10 /usr/xpg4/bin/sh or /bin/ksh, it fails spuriously with a message like: t0000-basic.sh[31]: unset: bad argument count This happens because those shells bail out when encountering a call to "unset" with no arguments, and such unset call could take place in 'test-lib.sh'. Fix that issue, and add a proper comment to ensure we don't regress in this respect. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a089a18..c0d04c4 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -42,10 +42,11 @@ TZ=UTC
TERM=dumb
export LANG LC_ALL PAGER TERM TZ
EDITOR=:
-unset VISUAL
-unset EMAIL
-unset LANGUAGE
-unset $(perl -e '
+# 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
+# ones.
+unset VISUAL EMAIL LANGUAGE $(perl -e '
my @env = keys %ENV;
my $ok = join("|", qw(
TRACE