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>
Stefano Lattarini committed
Mar 2, 2012 at 19:48 UTC
661bfd13b49db0affebbdda5ac478ebe67634947
1 file changed
+5
-4
t/test-lib.sh
+5
-4
@@ -42,10 +42,11 @@ TZ=UTC
42
TERM=dumb
43
export LANG LC_ALL PAGER TERM TZ
44
EDITOR=:
45
-unset VISUAL
46
-unset EMAIL
47
-unset LANGUAGE
48
-unset $(perl -e '
45
+# A call to "unset" with no arguments causes at least Solaris 10
46
+# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
47
+# deriving from the command substitution clustered with the other
48
+# ones.
49
+unset VISUAL EMAIL LANGUAGE $(perl -e '
50
my @env = keys %ENV;
51
my $ok = join("|", qw(
52
TRACE