Merge branch 'jt/avoid-ls-refs'
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)
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

1  2 
builtin/fetch.c
fetch-pack.c
t/t5551-http-fetch-smart.sh
t/t5702-protocol-v2.sh
transport.c
diff --cc builtin/fetch.c
Simple merge
diff --cc fetch-pack.c
index 49ab2666b9bdc889b6ddb17b43893b5c4fc6a308,15652b47762d131d22814ac122a7e216eda8164c..bff05ee69e54c5beabdc6415aba1c4e3a0118244
@@@ -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 (!ref) {
 +      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 (version != protocol_v2 && !ref) {
                packet_flush(fd[1]);
                die(_("no matching remote head"));
        }
Simple merge
Simple merge
diff --cc transport.c
Simple merge