add: speed up cmd_add() by utilizing read_cache_preload()
[gitweb.git] / fetch-pack.c
index 49ab2666b9bdc889b6ddb17b43893b5c4fc6a308..b3ed7121bc86805e87e909ff995eb8b439a2f995 100644 (file)
@@ -76,8 +76,7 @@ struct alternate_object_cache {
        size_t nr, alloc;
 };
 
-static void cache_one_alternate(const char *refname,
-                               const struct object_id *oid,
+static void cache_one_alternate(const struct object_id *oid,
                                void *vcache)
 {
        struct alternate_object_cache *cache = vcache;
@@ -1626,7 +1625,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
                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"));
        }