diff options
author | Jeff King <peff@peff.net> | 2013-09-19 00:05:13 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-19 00:34:12 +0400 |
commit | 68b939b2f097b6675c4aaa178655559aa81b25cb (patch) | |
tree | 1c7fa9e2264491ead3357f6b8b33ae65f56ccb16 /t | |
parent | e230c568c4b9a991e3175e5f65171a566fd8e39c (diff) |
clone: send diagnostic messages to stderr
Putting messages like "Cloning into.." and "done" on stdout
is un-Unix and uselessly clutters the stdout channel. Send
them to stderr.
We have to tweak two tests to accommodate this:
1. t5601 checks for doubled output due to forking, and
doesn't actually care where the output goes; adjust it
to check stderr.
2. t5702 is trying to test whether progress output was
sent to stderr, but naively does so by checking
whether stderr produced any output. Instead, have it
look for "%", a token found in progress output but not
elsewhere (and which lets us avoid hard-coding the
progress text in the test).
This should not regress any scripts that try to parse the
current output, as the output is already internationalized
and therefore unstable.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5601-clone.sh | 2 | ||||
-rwxr-xr-x | t/t5702-clone-options.sh | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 0629149edd..b3b11e61c0 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -36,7 +36,7 @@ test_expect_success 'clone with excess parameters (2)' ' test_expect_success C_LOCALE_OUTPUT 'output from clone' ' rm -fr dst && - git clone -n "file://$(pwd)/src" dst >output && + git clone -n "file://$(pwd)/src" dst >output 2>&1 && test $(grep Clon output | wc -l) = 1 ' diff --git a/t/t5702-clone-options.sh b/t/t5702-clone-options.sh index 85cadfad6d..d3dbdfe069 100755 --- a/t/t5702-clone-options.sh +++ b/t/t5702-clone-options.sh @@ -19,17 +19,18 @@ test_expect_success 'clone -o' ' ' -test_expect_success 'redirected clone' ' +test_expect_success 'redirected clone does not show progress' ' git clone "file://$(pwd)/parent" clone-redirected >out 2>err && - test_must_be_empty err + ! grep % err ' -test_expect_success 'redirected clone -v' ' + +test_expect_success 'redirected clone -v does show progress' ' git clone --progress "file://$(pwd)/parent" clone-redirected-progress \ >out 2>err && - test -s err + grep % err ' |