]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib: whitelist GIT_TR2_* in the environment
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 30 Mar 2019 07:51:19 +0000 (08:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2019 08:36:18 +0000 (17:36 +0900)
Add GIT_TR2_* to the whitelist of environment variables that we don't
clear when running the test suite.

This allows us to use the test suite to produce trace2 test data,
which is handy to e.g. write consumers that collate the trace data
itself.

One caveat here is that we produce trace output for not *just* the
tests, but also e.g. from this line in test-lib.sh:

    # It appears that people try to run tests without building...
    "${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X" >/dev/null
    [...]

I consider this not just OK but a feature. Let's log *all* the git
commands we're going to execute, not just those within
test_expect_*().

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh

index 562c57e6858b79aff074fcb7ab8c65fa2f110bc0..f6318c54c901bb3d1990fc59adcaf02686dc6c75 100644 (file)
@@ -379,6 +379,7 @@ unset VISUAL EMAIL LANGUAGE COLUMNS $("$PERL_PATH" -e '
        my @env = keys %ENV;
        my $ok = join("|", qw(
                TRACE
+               TR2_
                DEBUG
                TEST
                .*_TEST