Skip to content

Commit ddacff2

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 be56e0c commit ddacff2

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

t/test-lib.sh

+12-17
Original file line numberDiff line numberDiff line change
@@ -496,23 +496,18 @@ EDITOR=:
496496
# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
497497
# deriving from the command substitution clustered with the other
498498
# ones.
499-
unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
500-
my @env = keys %ENV;
501-
my $ok = join("|", qw(
502-
TRACE
503-
DEBUG
504-
TEST
505-
.*_TEST
506-
PROVE
507-
VALGRIND
508-
UNZIP
509-
PERF_
510-
CURL_VERBOSE
511-
TRACE_CURL
512-
));
513-
my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
514-
print join("\n", @vars);
515-
')
499+
unset VISUAL EMAIL LANGUAGE $(env | sed -n \
500+
-e '/^GIT_TRACE/d' \
501+
-e '/^GIT_DEBUG/d' \
502+
-e '/^GIT_TEST/d' \
503+
-e '/^GIT_.*_TEST/d' \
504+
-e '/^GIT_PROVE/d' \
505+
-e '/^GIT_VALGRIND/d' \
506+
-e '/^GIT_UNZIP/d' \
507+
-e '/^GIT_PERF_/d' \
508+
-e '/^GIT_CURL_VERBOSE/d' \
509+
-e '/^GIT_TRACE_CURL/d' \
510+
-e 's/^\(GIT_[^=]*\)=.*/\1/p')
516511
unset XDG_CACHE_HOME
517512
unset XDG_CONFIG_HOME
518513
unset GITPERLLIB

0 commit comments

Comments
 (0)