From 080bc4990f56f9d0687919e5136cb138509f1269 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 8 Sep 2022 15:24:21 -0400 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- builtin/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2