Skip to content

Commit c20bf94

Browse files
szedergitster
authored andcommitted
t9402-git-cvsserver-refs: don't check the stderr of a subshell
Four 'cvs diff' related tests in 't9402-git-cvsserver-refs.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 the emptiness of a subshell's stderr, which includes the trace of commands executed in that subshell as well, throwing off the emptiness check. Save the stdout and stderr of the invoked 'cvs' command instead of the whole subshell, so the latter remains free from tracing output. (Note that changing how stdout is saved is only done for the sake of consistency, it's not necessary for correctness.) After this change t9402 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 54ce2e9 commit c20bf94

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t9402-git-cvsserver-refs.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,20 +455,20 @@ test_expect_success 'cvs up -r $(git rev-parse v1)' '
455455
'
456456

457457
test_expect_success 'cvs diff -r v1 -u' '
458-
( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
458+
( cd cvswork && cvs -f diff -r v1 -u >../cvsDiff.out 2>../cvs.log ) &&
459459
test_must_be_empty cvsDiff.out &&
460460
test_must_be_empty cvs.log
461461
'
462462

463463
test_expect_success 'cvs diff -N -r v2 -u' '
464-
( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
464+
( cd cvswork && ! cvs -f diff -N -r v2 -u >../cvsDiff.out 2>../cvs.log ) &&
465465
test_must_be_empty cvs.log &&
466466
test -s cvsDiff.out &&
467467
check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
468468
'
469469

470470
test_expect_success 'cvs diff -N -r v2 -r v1.2' '
471-
( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
471+
( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u >../cvsDiff.out 2>../cvs.log ) &&
472472
test_must_be_empty cvs.log &&
473473
test -s cvsDiff.out &&
474474
check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
@@ -487,7 +487,7 @@ test_expect_success 'apply early [cvswork3] diff to b3' '
487487
'
488488

489489
test_expect_success 'check [cvswork3] diff' '
490-
( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
490+
( cd cvswork3 && ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out" 2>../cvs.log ) &&
491491
test_must_be_empty cvs.log &&
492492
test -s cvsDiff.out &&
493493
test $(grep Index: cvsDiff.out | wc -l) = 3 &&

0 commit comments

Comments
 (0)