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>

Jeff King committed Sep 8, 2022 at 15:24 UTC 080bc4990f56f9d0687919e5136cb138509f1269
1 file changed +1 -1
builtin/fetch.c
+1 -1
@@ -1626,7 +1626,7 @@ static int do_fetch(struct transport *transport,
1626 break;
1627 }
1628 }
1629 - } else if (transport->remote && transport->remote->fetch.nr)
1629 + } else if (transport->remote->fetch.nr)
1630 refspec_ref_prefixes(&transport->remote->fetch,
1631 &transport_ls_refs_options.ref_prefixes);
1632