Simplify fetch transport API to just one function
Commit walkers need to know the SHA-1 name of any objects they have been asked to fetch while the native pack transport only wants to know the names of the remote refs as the remote side must do the name->SHA-1 translation. Since we only have three fetch implementations and one of them (bundle) doesn't even need the name information we can reduce the code required to perform a fetch by having just one function and passing of the filtered list of refs to be fetched. Each transport can then obtain the information it needs from that ref array to construct its own internal operation state. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Conflicts: transport.c Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
7a2bff4593
commit
425b139313
@ -355,7 +355,7 @@ static int do_fetch(struct transport *transport,
|
||||
no_tags = 1;
|
||||
|
||||
if (!transport->ops || !transport->ops->get_refs_list ||
|
||||
!(transport->ops->fetch_refs || transport->ops->fetch_objs))
|
||||
!transport->ops->fetch)
|
||||
die("Don't know how to fetch from %s", transport->url);
|
||||
|
||||
/* if not appending, truncate FETCH_HEAD */
|
||||
|
||||
Reference in New Issue
Block a user