Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-10-16 22:37:02 +0400
committerJunio C Hamano <gitster@pobox.com>2010-10-19 03:20:19 +0400
commit8ac3ed27d4ca6b3c89c51e4d90e2e7be5de5ab15 (patch)
tree1c75b44c53239ff87ff393b3f62bbeeafd85a083 /t/t5523-push-upstream.sh
parent2d59ced10418f60914f353031215ecc6adcef204 (diff)
t5523-push-upstream: test progress messages
Reported-by: Chase Brammer <cbrammer@gmail.com> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5523-push-upstream.sh')
-rwxr-xr-xt/t5523-push-upstream.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index 5a18533ad7..f43d76063e 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() {
rm -rf parent && git init --bare parent
@@ -70,4 +71,41 @@ test_expect_success 'push -u HEAD' '
check_config headbranch upstream refs/heads/headbranch
'
+test_expect_success TTY 'progress messages go to tty' '
+ ensure_fresh_upstream &&
+
+ test_terminal git push -u upstream master >out 2>err &&
+ grep "Writing objects" err
+'
+
+test_expect_failure 'progress messages do not go to non-tty' '
+ ensure_fresh_upstream &&
+
+ # skip progress messages, since stderr is non-tty
+ git push -u upstream master >out 2>err &&
+ ! grep "Writing objects" err
+'
+
+test_expect_failure 'progress messages go to non-tty (forced)' '
+ ensure_fresh_upstream &&
+
+ # force progress messages to stderr, even though it is non-tty
+ git push -u --progress upstream master >out 2>err &&
+ grep "Writing objects" err
+'
+
+test_expect_success TTY '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 TTY '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