diff options
author | Øystein Walle <oystwa@gmail.com> | 2021-04-15 12:33:53 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-15 19:52:49 (GMT) |
commit | f3cce896a8e14e4732f45a6ee46f77e7ed17a990 (patch) | |
tree | 6a9bc83a62fc730c80962f97690c6cd4854fbd16 /transport.c | |
parent | 48bf2fa8bad054d66bd79c6ba903c89c704201f7 (diff) | |
download | git-f3cce896a8e14e4732f45a6ee46f77e7ed17a990.zip git-f3cce896a8e14e4732f45a6ee46f77e7ed17a990.tar.gz git-f3cce896a8e14e4732f45a6ee46f77e7ed17a990.tar.bz2 |
transport: respect verbosity when setting upstream
A command such as `git push -qu origin feature` will print "Branch
'feature' set up to track remote branch 'feature' from 'origin'." even
when --quiet is passed. In this case it's because install_branch_config() is
always called with BRANCH_CONFIG_VERBOSE.
struct transport keeps track of the desired verbosity. Fix the above
issue by passing BRANCH_CONFIG_VERBOSE conditionally based on that.
Signed-off-by: Øystein Walle <oystwa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/transport.c b/transport.c index 1c4ab67..b5452b6 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); |