Skip to content

Commit d6109cc

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 b1bd05e commit d6109cc

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
@@ -459,23 +459,18 @@ EDITOR=:
459459
# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
460460
# deriving from the command substitution clustered with the other
461461
# ones.
462-
unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
463-
my @env = keys %ENV;
464-
my $ok = join("|", qw(
465-
TRACE
466-
DEBUG
467-
TEST
468-
.*_TEST
469-
PROVE
470-
VALGRIND
471-
UNZIP
472-
PERF_
473-
CURL_VERBOSE
474-
TRACE_CURL
475-
));
476-
my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
477-
print join("\n", @vars);
478-
')
462+
unset VISUAL EMAIL LANGUAGE $(env | sed -n \
463+
-e '/^GIT_TRACE/d' \
464+
-e '/^GIT_DEBUG/d' \
465+
-e '/^GIT_TEST/d' \
466+
-e '/^GIT_.*_TEST/d' \
467+
-e '/^GIT_PROVE/d' \
468+
-e '/^GIT_VALGRIND/d' \
469+
-e '/^GIT_UNZIP/d' \
470+
-e '/^GIT_PERF_/d' \
471+
-e '/^GIT_CURL_VERBOSE/d' \
472+
-e '/^GIT_TRACE_CURL/d' \
473+
-e 's/^\(GIT_[^=]*\)=.*/\1/p')
479474
unset XDG_CACHE_HOME
480475
unset XDG_CONFIG_HOME
481476
unset GITPERLLIB

0 commit comments

Comments
 (0)