зеркало из https://github.com/microsoft/git.git
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 <johannes.schindelin@gmx.de>
This commit is contained in:
Родитель
1fa7c9b7bf
Коммит
cb29761cc7
|
@ -468,23 +468,18 @@ EDITOR=:
|
|||
# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
|
||||
# deriving from the command substitution clustered with the other
|
||||
# ones.
|
||||
unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
|
||||
my @env = keys %ENV;
|
||||
my $ok = join("|", qw(
|
||||
TRACE
|
||||
DEBUG
|
||||
TEST
|
||||
.*_TEST
|
||||
PROVE
|
||||
VALGRIND
|
||||
UNZIP
|
||||
PERF_
|
||||
CURL_VERBOSE
|
||||
TRACE_CURL
|
||||
));
|
||||
my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
|
||||
print join("\n", @vars);
|
||||
')
|
||||
unset VISUAL EMAIL LANGUAGE $(env | sed -n \
|
||||
-e '/^GIT_TRACE/d' \
|
||||
-e '/^GIT_DEBUG/d' \
|
||||
-e '/^GIT_TEST/d' \
|
||||
-e '/^GIT_.*_TEST/d' \
|
||||
-e '/^GIT_PROVE/d' \
|
||||
-e '/^GIT_VALGRIND/d' \
|
||||
-e '/^GIT_UNZIP/d' \
|
||||
-e '/^GIT_PERF_/d' \
|
||||
-e '/^GIT_CURL_VERBOSE/d' \
|
||||
-e '/^GIT_TRACE_CURL/d' \
|
||||
-e 's/^\(GIT_[^=]*\)=.*/\1/p')
|
||||
unset XDG_CACHE_HOME
|
||||
unset XDG_CONFIG_HOME
|
||||
unset GITPERLLIB
|
||||
|
|
Загрузка…
Ссылка в новой задаче