Skip to content

Commit 8a3bd56

Browse files
committed
test-lib: avoid unnecessary Perl invocation
It is a bit strange, and even undesirable, to require Perl just to run the test suite even when NO_PERL was set. This patch does not fix this problem by any stretch of imagination. However, it fixes *the* Perl invocation that *every single* test script has to run. While at it, it makes the source code also more grep'able, as the code that unsets some, but not all, GIT_* environment variables just became a *lot* more explicit. And all that while still reducing the total number of lines. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0455ac6 commit 8a3bd56

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

t/test-lib.sh

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -429,23 +429,18 @@ EDITOR=:
429429
# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
430430
# deriving from the command substitution clustered with the other
431431
# ones.
432-
unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
433-
my @env = keys %ENV;
434-
my $ok = join("|", qw(
435-
TRACE
436-
DEBUG
437-
TEST
438-
.*_TEST
439-
PROVE
440-
VALGRIND
441-
UNZIP
442-
PERF_
443-
CURL_VERBOSE
444-
TRACE_CURL
445-
));
446-
my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
447-
print join("\n", @vars);
448-
')
432+
unset VISUAL EMAIL LANGUAGE $(env | sed -n \
433+
-e '/^GIT_TRACE/d' \
434+
-e '/^GIT_DEBUG/d' \
435+
-e '/^GIT_TEST/d' \
436+
-e '/^GIT_.*_TEST/d' \
437+
-e '/^GIT_PROVE/d' \
438+
-e '/^GIT_VALGRIND/d' \
439+
-e '/^GIT_UNZIP/d' \
440+
-e '/^GIT_PERF_/d' \
441+
-e '/^GIT_CURL_VERBOSE/d' \
442+
-e '/^GIT_TRACE_CURL/d' \
443+
-e 's/^\(GIT_[^=]*\)=.*/\1/p')
449444
unset XDG_CACHE_HOME
450445
unset XDG_CONFIG_HOME
451446
unset GITPERLLIB

0 commit comments

Comments
 (0)