From: Eric Sunshine Date: Sat, 24 Feb 2018 08:04:20 GMT Subject: Re: [PATCH 04/11] t3030-merge-recursive: don't check the stderr of a subshell Message-ID: In-Reply-To: <20180223233951.11154-5-szeder.dev@gmail.com> On Fri, Feb 23, 2018 at 6:39 PM, SZEDER Gábor wrote: > The two test checking 'git mmerge-recursive' in an empty worktree in s/mmerge/merge/, I guess. > '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