do not use GIT_TRACE_PACKET=3 in tests
commit2ad23273e71ff708936bd924502186b8789a7289
authorJeff King <peff@peff.net>
Wed, 20 Mar 2013 17:43:47 +0000 (20 13:43 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Mar 2013 15:03:32 +0000 (21 08:03 -0700)
treea1351171a6ea743791c532170a442c302f648617
parent2a4552021a92be17c7c4d2d2313df9913e8eb4bf
do not use GIT_TRACE_PACKET=3 in tests

Some test scripts use the GIT_TRACE mechanism to dump
debugging information to descriptor 3 (and point it to a
file using the shell). On Windows, however, bash is unable
to set up descriptor 3. We do not write our trace to the
file, and worse, we may interfere with other operations
happening on descriptor 3, causing tests to fail or even
behave inconsistently.

Prior to commit 97a83fa (upload-pack: remove packet debugging
harness), these tests used GIT_DEBUG_SEND_PACK, which only
supported output to a descriptor. The tests in t5503 were
always broken on Windows, and were marked to be skipped via
the NOT_MINGW prerequisite. In t5700, the tests used to pass
prior to 97a83fa, but only because they were not careful
enough; because we only grepped the trace file, an empty
file looked successful to us. But post-97a83fa, the writing
to descriptor 3 causes "git fetch" to hang (presumably
because we are throwing random bytes into the middle of the
protocol).

Now that we are using the GIT_TRACE mechanism, we can
improve both scripts by asking git to write directly to a
file rather than a descriptor. That fixes the hang in t5700,
and should allow t5503 to successfully run on Windows.

In both cases we now also use "test -s" to double-check that
our trace file actually contains output, which should reduce
the possibility of an erroneously passing test.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5503-tagfollow.sh
t/t5700-clone-reference.sh