Skip to content
  • Gábor Szeder's avatar
    t3030-merge-recursive: don't check the stderr of a subshell · 40dc533f
    Gábor Szeder authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarSZEDER Gábor <szeder.dev@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    40dc533f