[PATCH 3/3] t5523: test push progress output to tty
From: Jeff King <hidden>
Date: 2016-06-15 22:49:47
Subsystem:
the rest · Maintainer:
Linus Torvalds
We already test the non-tty cases, but until recent changes made lib-terminal.sh available, we couldn't test the case with a tty. These tests reveal a bug: --no-progress is silently ignored. Signed-off-by: Jeff King <redacted> --- t/t5523-push-upstream.sh | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index 113626b..78c5978 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh@@ -2,6 +2,7 @@ test_description='push with --set-upstream' . ./test-lib.sh +. "$TEST_DIRECTORY"/lib-terminal.sh ensure_fresh_upstream() { test -d parent &&
@@ -72,7 +73,14 @@ test_expect_success 'push -u HEAD' ' check_config headbranch upstream refs/heads/headbranch ' -test_expect_success 'progress messages to non-tty' ' +test_expect_success 'progress messages go to tty' ' + ensure_fresh_upstream && + + test_terminal git push -u upstream master >out 2>err && + grep "Writing objects" err +' + +test_expect_success 'progress messages do not go to non-tty' ' ensure_fresh_upstream && # skip progress messages, since stderr is non-tty
@@ -80,7 +88,7 @@ test_expect_success 'progress messages to non-tty' ' ! grep "Writing objects" err ' -test_expect_success 'progress messages to non-tty (forced)' ' +test_expect_success 'progress messages go to non-tty (forced)' ' ensure_fresh_upstream && # force progress messages to stderr, even though it is non-tty
@@ -88,4 +96,18 @@ test_expect_success 'progress messages to non-tty (forced)' ' grep "Writing objects" err ' +test_expect_success 'push -q suppresses progress' ' + ensure_fresh_upstream && + + test_terminal git push -u -q upstream master >out 2>err && + ! grep "Writing objects" err +' + +test_expect_failure 'push --no-progress suppresses progress' ' + ensure_fresh_upstream && + + test_terminal git push -u --no-progress upstream master >out 2>err && + ! grep "Writing objects" err +' + test_done
--
1.7.3.1.204.g337d6.dirty