Skip to content

Commit 080bc49

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ac8035a commit 080bc49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@ static int do_fetch(struct transport *transport,
16261626
break;
16271627
}
16281628
}
1629-
} else if (transport->remote && transport->remote->fetch.nr)
1629+
} else if (transport->remote->fetch.nr)
16301630
refspec_ref_prefixes(&transport->remote->fetch,
16311631
&transport_ls_refs_options.ref_prefixes);
16321632

0 commit comments

Comments
 (0)