mirror of
https://github.com/git/git.git
synced 2024-10-30 22:07:53 +01:00
c207e34f77
Currently, git push --quiet produces some non-error output, e.g.:
$ git push --quiet
Unpacking objects: 100% (3/3), done.
This fixes a bug reported for the fedora git package:
https://bugzilla.redhat.com/show_bug.cgi?id=725593
Reported-by: Jesse Keating <jkeating@redhat.com>
Cc: Todd Zullinger <tmz@pobox.com>
Commit 90a6c7d4
(propagate --quiet to send-pack/receive-pack)
introduced the --quiet option to receive-pack and made send-pack
pass that option. Older versions of receive-pack do not recognize
the option, however, and terminate immediately. The commit was
therefore reverted.
This change instead adds a 'quiet' capability to receive-pack,
which is a backwards compatible.
In addition, this fixes push --quiet via http: A verbosity of 0
means quiet for remote helpers.
Reported-by: Tobias Ulmer <tobiasu@tmux.org>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
118 lines
2.9 KiB
Bash
Executable file
118 lines
2.9 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='push with --set-upstream'
|
|
. ./test-lib.sh
|
|
. "$TEST_DIRECTORY"/lib-terminal.sh
|
|
|
|
ensure_fresh_upstream() {
|
|
rm -rf parent && git init --bare parent
|
|
}
|
|
|
|
test_expect_success 'setup bare parent' '
|
|
ensure_fresh_upstream &&
|
|
git remote add upstream parent
|
|
'
|
|
|
|
test_expect_success 'setup local commit' '
|
|
echo content >file &&
|
|
git add file &&
|
|
git commit -m one
|
|
'
|
|
|
|
check_config() {
|
|
(echo $2; echo $3) >expect.$1
|
|
(git config branch.$1.remote
|
|
git config branch.$1.merge) >actual.$1
|
|
test_cmp expect.$1 actual.$1
|
|
}
|
|
|
|
test_expect_success 'push -u master:master' '
|
|
git push -u upstream master:master &&
|
|
check_config master upstream refs/heads/master
|
|
'
|
|
|
|
test_expect_success 'push -u master:other' '
|
|
git push -u upstream master:other &&
|
|
check_config master upstream refs/heads/other
|
|
'
|
|
|
|
test_expect_success 'push -u --dry-run master:otherX' '
|
|
git push -u --dry-run upstream master:otherX &&
|
|
check_config master upstream refs/heads/other
|
|
'
|
|
|
|
test_expect_success 'push -u master2:master2' '
|
|
git branch master2 &&
|
|
git push -u upstream master2:master2 &&
|
|
check_config master2 upstream refs/heads/master2
|
|
'
|
|
|
|
test_expect_success 'push -u master2:other2' '
|
|
git push -u upstream master2:other2 &&
|
|
check_config master2 upstream refs/heads/other2
|
|
'
|
|
|
|
test_expect_success 'push -u :master2' '
|
|
git push -u upstream :master2 &&
|
|
check_config master2 upstream refs/heads/other2
|
|
'
|
|
|
|
test_expect_success 'push -u --all' '
|
|
git branch all1 &&
|
|
git branch all2 &&
|
|
git push -u --all &&
|
|
check_config all1 upstream refs/heads/all1 &&
|
|
check_config all2 upstream refs/heads/all2
|
|
'
|
|
|
|
test_expect_success 'push -u HEAD' '
|
|
git checkout -b headbranch &&
|
|
git push -u upstream 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_success '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_success '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_expect_success TTY 'quiet push' '
|
|
ensure_fresh_upstream &&
|
|
|
|
test_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&
|
|
test_cmp /dev/null output
|
|
'
|
|
|
|
test_done
|