aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/push.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-06-14 06:42:03 -0400
committerJunio C Hamano <gitster@pobox.com>2024-06-14 09:34:39 -0700
commitaecd794fca275b42e271b80236e95f0d288bd709 (patch)
tree109cc0ab15551b45c7a98780c9d0b1da8db99572 /builtin/push.c
parentremote: always require at least one url in a remote (diff)
downloadgit-aecd794fca275b42e271b80236e95f0d288bd709.tar.gz
git-aecd794fca275b42e271b80236e95f0d288bd709.zip
remote: drop checks for zero-url case
Now that the previous commit removed the possibility that a "struct remote" will ever have zero url fields, we can drop a number of redundant checks and untriggerable code paths. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/push.c')
-rw-r--r--builtin/push.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/builtin/push.c b/builtin/push.c
index 00d99af1a8..8260c6e46a 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -438,18 +438,9 @@ static int do_push(int flags,
}
errs = 0;
url = push_url_of_remote(remote);
- if (url->nr) {
- for (i = 0; i < url->nr; i++) {
- struct transport *transport =
- transport_get(remote, url->v[i]);
- if (flags & TRANSPORT_PUSH_OPTIONS)
- transport->push_options = push_options;
- if (push_with_options(transport, push_refspec, flags))
- errs++;
- }
- } else {
+ for (i = 0; i < url->nr; i++) {
struct transport *transport =
- transport_get(remote, NULL);
+ transport_get(remote, url->v[i]);
if (flags & TRANSPORT_PUSH_OPTIONS)
transport->push_options = push_options;
if (push_with_options(transport, push_refspec, flags))