t9402-git-cvsserver-refs: don't check the stderr of a subshell
commitc20bf94abcf49323fdbd398c412a6cf6af3f3a61
authorSZEDER Gábor <szeder.dev@gmail.com>
Thu, 8 Mar 2018 12:38:44 +0000 (8 13:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Mar 2018 23:37:14 +0000 (8 15:37 -0800)
treef957d2e0200cff3b055cf5e884afa4df07054adf
parent54ce2e9be987e4b0aea354e2db708c94f1708f85
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 <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9402-git-cvsserver-refs.sh