Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2022-09-08 22:24:21 +0300
committerJunio C Hamano <gitster@pobox.com>2022-09-08 23:10:32 +0300
commit080bc4990f56f9d0687919e5136cb138509f1269 (patch)
tree34e8c88a9d129b2d51bee46cc58e22ad4148c0fd /builtin
parentac8035a2affdf30f2c691ad760826d955bba0507 (diff)
fetch: stop checking for NULL transport->remote in do_fetch()
This field will never be NULL; if it were, we'd segfault earlier in the function when we unconditionally check transport->remote->fetch_tags. Likewise, many other functions dereference it unconditionally. This is a small simplification, but it will make things easier as we extend this conditional in the next patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fetch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index ac29c2b1ae..d39098d9ab 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1626,7 +1626,7 @@ static int do_fetch(struct transport *transport,
break;
}
}
- } else if (transport->remote && transport->remote->fetch.nr)
+ } else if (transport->remote->fetch.nr)
refspec_ref_prefixes(&transport->remote->fetch,
&transport_ls_refs_options.ref_prefixes);