Skip to content

Commit 797e2cf

Browse files
peffgitster
authored andcommitted
t0000: disable GIT_TEST_FAIL_PREREQS in sub-tests
The test added by 477dcad (tests: do not let lazy prereqs inside `test_expect_*` turn off tracing, 2020-03-26) runs a sub-test script that traces a test with a lazy prereq, like: test_have_prereq LAZY && echo trace That won't work if GIT_TEST_FAIL_PREREQS is set in the environment, because our have_prereq will report failure, and we won't run the echo at all. We could work around this by avoiding the &&-chain, but we can fix this and any future tests at once by unsetting that variable for our sub-tests. These are meant to be controlled environments where we test the test-suite itself; the outer test snippet should be in charge of the sub-test environment, not whatever mode the user happens to be running in. Reported-by: Son Luong Ngoc <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e870325 commit 797e2cf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/t0000-basic.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ _run_sub_test_lib_test_common () {
9898
export TEST_DIRECTORY &&
9999
TEST_OUTPUT_DIRECTORY=$(pwd) &&
100100
export TEST_OUTPUT_DIRECTORY &&
101+
sane_unset GIT_TEST_FAIL_PREREQS &&
101102
if test -z "$neg"
102103
then
103104
./"$name.sh" "$@" >out 2>err

0 commit comments

Comments
 (0)