t5570-git-daemon: don't check the stderr of a subshell
authorSZEDER Gábor <szeder.dev@gmail.com>
Fri, 23 Feb 2018 23:39:47 +0000 (00:39 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2018 20:57:51 +0000 (12:57 -0800)
The test 'no-op fetch without "-v" is quiet' in 't5570-git-daemon.sh'
fails when the test script is run with '-x' tracing (and using a shell
other than a Bash version supporting BASH_XTRACEFD). The reason for
the failure is that the test checks 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 stderr of 'git fetch' only instead of the whole subshell's, so
it remains free from tracing output.

After this change t5570 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/t5570-git-daemon.sh
index 755b05a8ae9de940be8d9ad4c89473d836dcdf20..0d4c52016b2b3651fa638fcc416f22d236c87fc2 100755 (executable)
@@ -50,7 +50,7 @@ test_expect_success 'no-op fetch -v stderr is as expected' '
 '
 
 test_expect_success 'no-op fetch without "-v" is quiet' '
-       (cd clone && git fetch) 2>stderr &&
+       (cd clone && git fetch 2>../stderr) &&
        ! test -s stderr
 '