Skip to content

Commit 661bfd1

Browse files
slattarinigitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 70eb130 commit 661bfd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

t/test-lib.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ TZ=UTC
4242
TERM=dumb
4343
export LANG LC_ALL PAGER TERM TZ
4444
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 '
4950
my @env = keys %ENV;
5051
my $ok = join("|", qw(
5152
TRACE

0 commit comments

Comments
 (0)