Skip to content

Commit ddcc426

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 3c30fa9 commit ddcc426

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
@@ -500,23 +500,18 @@ EDITOR=:
500500
# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
501501
# deriving from the command substitution clustered with the other
502502
# ones.
503-
unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
504-
my @env = keys %ENV;
505-
my $ok = join("|", qw(
506-
TRACE
507-
DEBUG
508-
TEST
509-
.*_TEST
510-
PROVE
511-
VALGRIND
512-
UNZIP
513-
PERF_
514-
CURL_VERBOSE
515-
TRACE_CURL
516-
));
517-
my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
518-
print join("\n", @vars);
519-
')
503+
unset VISUAL EMAIL LANGUAGE $(env | sed -n \
504+
-e '/^GIT_TRACE/d' \
505+
-e '/^GIT_DEBUG/d' \
506+
-e '/^GIT_TEST/d' \
507+
-e '/^GIT_.*_TEST/d' \
508+
-e '/^GIT_PROVE/d' \
509+
-e '/^GIT_VALGRIND/d' \
510+
-e '/^GIT_UNZIP/d' \
511+
-e '/^GIT_PERF_/d' \
512+
-e '/^GIT_CURL_VERBOSE/d' \
513+
-e '/^GIT_TRACE_CURL/d' \
514+
-e 's/^\(GIT_[^=]*\)=.*/\1/p')
520515
unset XDG_CACHE_HOME
521516
unset XDG_CONFIG_HOME
522517
unset GITPERLLIB

0 commit comments

Comments
 (0)