Skip to content

Commit 84e1830

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 de1acb0 commit 84e1830

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
@@ -368,23 +368,18 @@ fi
368368
# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
369369
# deriving from the command substitution clustered with the other
370370
# ones.
371-
unset VISUAL EMAIL LANGUAGE COLUMNS $("$PERL_PATH" -e '
372-
my @env = keys %ENV;
373-
my $ok = join("|", qw(
374-
TRACE
375-
DEBUG
376-
TEST
377-
.*_TEST
378-
PROVE
379-
VALGRIND
380-
UNZIP
381-
PERF_
382-
CURL_VERBOSE
383-
TRACE_CURL
384-
));
385-
my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
386-
print join("\n", @vars);
387-
')
371+
unset VISUAL EMAIL LANGUAGE COLUMNS $(env | sed -n \
372+
-e '/^GIT_TRACE/d' \
373+
-e '/^GIT_DEBUG/d' \
374+
-e '/^GIT_TEST/d' \
375+
-e '/^GIT_.*_TEST/d' \
376+
-e '/^GIT_PROVE/d' \
377+
-e '/^GIT_VALGRIND/d' \
378+
-e '/^GIT_UNZIP/d' \
379+
-e '/^GIT_PERF_/d' \
380+
-e '/^GIT_CURL_VERBOSE/d' \
381+
-e '/^GIT_TRACE_CURL/d' \
382+
-e 's/^\(GIT_[^=]*\)=.*/\1/p')
388383
unset XDG_CACHE_HOME
389384
unset XDG_CONFIG_HOME
390385
unset GITPERLLIB

0 commit comments

Comments
 (0)