t3030-merge-recursive: don't check the stderr of a subshell
commit40dc533f5776aa0fe194176032f7eb38ee5f44b7
authorSZEDER Gábor <szeder.dev@gmail.com>
Fri, 23 Feb 2018 23:39:44 +0000 (24 00:39 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2018 20:57:51 +0000 (28 12:57 -0800)
tree477dab44637e33e5ab34a5ada01109f25be759f2
parentc3a44562431515210197b1344d7285be2763e8f5
t3030-merge-recursive: don't check the stderr of a subshell

The two test checking 'git mmerge-recursive' in an empty worktree in
't3030-merge-recursive.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.

Note that both subshells execute four git commands each, meaning that
checking the emptiness of the whole subshell implicitly ensures that
not only 'git merge-recursive' but none of the other three commands
outputs anything to their stderr.  Note also that if one of those
commands were to output anything on its stderr, then the current
combined check would not tell us which one of those four commands the
unexpected output came from.

Save the stderr of those four commands only instead of the whole
subshell, so it remains free from tracing output, and save and check
them individually, so they will show us from which command the
unexpected output came from.

After this change t3030 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/t3030-merge-recursive.sh