Skip to content

Commit fa06eb6

Browse files
szedergitster
authored andcommitted
t5500-fetch-pack: don't check the stderr of a subshell
Three "missing reference" tests in 't5500-fetch-pack.sh' fail when the test script is run with '-x' tracing (and using a shell other than a Bash version supporting BASH_XTRACEFD). The reason for those failures is that the tests check a subshell's stderr, which includes the trace of executing commands in that subshell as well, throwing off the comparison with the expected output. Save the stderr of 'git fetch-pack' only instead of the whole subshell, so it remains free from tracing output. After this change t5500 passes with '-x', even when running with /bin/sh. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 40dc533 commit fa06eb6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t5500-fetch-pack.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,24 +482,24 @@ test_expect_success 'set up tests of missing reference' '
482482
test_expect_success 'test lonely missing ref' '
483483
(
484484
cd client &&
485-
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy
486-
) >/dev/null 2>error-m &&
485+
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy 2>../error-m
486+
) &&
487487
test_i18ncmp expect-error error-m
488488
'
489489

490490
test_expect_success 'test missing ref after existing' '
491491
(
492492
cd client &&
493-
test_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy
494-
) >/dev/null 2>error-em &&
493+
test_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy 2>../error-em
494+
) &&
495495
test_i18ncmp expect-error error-em
496496
'
497497

498498
test_expect_success 'test missing ref before existing' '
499499
(
500500
cd client &&
501-
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A
502-
) >/dev/null 2>error-me &&
501+
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A 2>../error-me
502+
) &&
503503
test_i18ncmp expect-error error-me
504504
'
505505

0 commit comments

Comments
 (0)