summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-04-30 13:50:24 +0900
committerJunio C Hamano <gitster@pobox.com>2021-04-30 13:50:25 +0900
commita819e2b3ef7c27d04befa0a345c9e6e3c7a7965e (patch)
tree33b1d63ea4be4c1c51a97377849b5a70025b12b3
parent279a2e637a69afd6157e8287c2599e8ae5e6cb8c (diff)
parentf3cce896a8e14e4732f45a6ee46f77e7ed17a990 (diff)
downloadgit-a819e2b3ef7c27d04befa0a345c9e6e3c7a7965e.tar.gz
Merge branch 'ow/push-quiet-set-upstream'
"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
-rwxr-xr-xt/t5523-push-upstream.sh7
-rw-r--r--transport.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index 9fbe7f784d..fdb4292056 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -119,4 +119,11 @@ test_expect_success TTY 'quiet push' '
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
diff --git a/transport.c b/transport.c
index ef66e73090..62b6eeed21 100644
--- a/transport.c
+++ b/transport.c
@@ -108,11 +108,11 @@ static void set_upstreams(struct transport *transport, struct ref *refs,
if (!remotename || !starts_with(remotename, "refs/heads/"))
continue;
- if (!pretend)
- install_branch_config(BRANCH_CONFIG_VERBOSE,
- localname + 11, transport->remote->name,
- remotename);
- else
+ if (!pretend) {
+ int flag = transport->verbose < 0 ? 0 : BRANCH_CONFIG_VERBOSE;
+ install_branch_config(flag, localname + 11,
+ transport->remote->name, remotename);
+ } else if (transport->verbose >= 0)
printf(_("Would set upstream of '%s' to '%s' of '%s'\n"),
localname + 11, remotename + 11,
transport->remote->name);