Skip to content

Commit

Permalink
t5523-push-upstream: test progress messages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tay Ray Chuan authored and Junio C Hamano committed Oct 18, 2010
1 parent 2d59ced commit 8ac3ed2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions t/t5523-push-upstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 8ac3ed2

Please sign in to comment.