From: Junio C Hamano Date: Fri, 19 Oct 2018 04:34:07 +0000 (+0900) Subject: Merge branch 'jt/avoid-ls-refs' X-Git-Tag: v2.20.0-rc0~150 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0527fbab689929de47ab3fa7baf1e7618ffa704f;p=thirdparty%2Fgit.git Merge branch 'jt/avoid-ls-refs' Over some transports, fetching objects with an exact commit object name can be done without first seeing the ref advertisements. The code has been optimized to exploit this. * jt/avoid-ls-refs: fetch: do not list refs if fetching only hashes transport: list refs before fetch if necessary transport: do not list refs if possible transport: allow skipping of ref listing --- 0527fbab689929de47ab3fa7baf1e7618ffa704f diff --cc fetch-pack.c index 49ab2666b9,15652b4776..bff05ee69e --- a/fetch-pack.c +++ b/fetch-pack.c @@@ -1612,21 -1598,7 +1612,21 @@@ struct ref *fetch_pack(struct fetch_pac if (nr_sought) nr_sought = remove_duplicates_in_refs(sought, nr_sought); + if (args->no_dependents && !args->filter_options.choice) { + /* + * The protocol does not support requesting that only the + * wanted objects be sent, so approximate this by setting a + * "blob:none" filter if no filter is already set. This works + * for all object types: note that wanted blobs will still be + * sent because they are directly specified as a "want". + * + * NEEDSWORK: Add an option in the protocol to request that + * only the wanted objects be sent, and implement it. + */ + parse_list_objects_filter(&args->filter_options, "blob:none"); + } + - if (!ref) { + if (version != protocol_v2 && !ref) { packet_flush(fd[1]); die(_("no matching remote head")); }