The test 'fetch --recurse-submodules -j2 has the same output
behaviour' in '' fails when the test script
is run with '-x' tracing (and using a shell other than a Bash version
supporting BASH_XTRACEFD).  The reason of that failure is the
following command:

  GIT_TRACE=$(pwd)/../trace.out git fetch <...> 2>../actual.err

because the trace of executing 'pwd' in the command substitution ends
up in 'actual.err' as well, throwing off the subsequent

Use $TRASH_DIRECTORY to specify the path of the GIT_TRACE log file
instead of $(pwd), so the command's stderr remains free from tracing

After this change t5526 passes with '-x', even when running with

Signed-off-by: SZEDER Gábor <>
 t/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/ b/t/
index a552ad4ead..ce44d8aa46 100755
--- a/t/
+++ b/t/
@@ -85,7 +85,7 @@ test_expect_success "fetch --recurse-submodules -j2 has the 
same output behaviou
        add_upstream_commit &&
                cd downstream &&
-               GIT_TRACE=$(pwd)/../trace.out git fetch --recurse-submodules 
-j2 2>../actual.err
+               GIT_TRACE="$TRASH_DIRECTORY/trace.out" git fetch 
--recurse-submodules -j2 2>../actual.err
        ) &&
        test_must_be_empty actual.out &&
        test_i18ncmp expect.err actual.err &&

Reply via email to