1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-27 14:36:11 +02:00

Merge branch 'ow/push-quiet-set-upstream' into next

"git push --quiet --set-upstream" was not quiet when setting the
upstream branch configuration, which has been corrected.

* ow/push-quiet-set-upstream:
  transport: respect verbosity when setting upstream
This commit is contained in:
Junio C Hamano 2021-04-16 13:56:24 -07:00
commit 9466d4ef38
2 changed files with 12 additions and 5 deletions

View File

@ -119,4 +119,11 @@ test_expect_success TTY 'quiet push' '
test_must_be_empty output test_must_be_empty output
' '
test_expect_success TTY 'quiet push -u' '
ensure_fresh_upstream &&
test_terminal git push --quiet -u --no-progress upstream main 2>&1 | tee output &&
test_must_be_empty output
'
test_done test_done

View File

@ -108,11 +108,11 @@ static void set_upstreams(struct transport *transport, struct ref *refs,
if (!remotename || !starts_with(remotename, "refs/heads/")) if (!remotename || !starts_with(remotename, "refs/heads/"))
continue; continue;
if (!pretend) if (!pretend) {
install_branch_config(BRANCH_CONFIG_VERBOSE, int flag = transport->verbose < 0 ? 0 : BRANCH_CONFIG_VERBOSE;
localname + 11, transport->remote->name, install_branch_config(flag, localname + 11,
remotename); transport->remote->name, remotename);
else } else if (transport->verbose >= 0)
printf(_("Would set upstream of '%s' to '%s' of '%s'\n"), printf(_("Would set upstream of '%s' to '%s' of '%s'\n"),
localname + 11, remotename + 11, localname + 11, remotename + 11,
transport->remote->name); transport->remote->name);