]> git.ipfire.org Git - thirdparty/git.git/blobdiff - pack-objects.c
upload-pack: pass upload_pack_data to send_acks()
[thirdparty/git.git] / pack-objects.c
index c6250d77f4dec714de1073ccc0260309c24f6312..f2a433885ac80ec9cbadfd3e5e7553655237c924 100644 (file)
@@ -119,7 +119,10 @@ void oe_map_new_pack(struct packing_data *pack)
 {
        uint32_t i;
 
-       REALLOC_ARRAY(pack->in_pack, pack->nr_alloc);
+       if (pack->in_pack)
+               BUG("packing_data has already been converted to pack array");
+
+       ALLOC_ARRAY(pack->in_pack, pack->nr_alloc);
 
        for (i = 0; i < pack->nr_objects; i++)
                pack->in_pack[i] = oe_in_pack(pack, pack->objects + i);
@@ -200,14 +203,14 @@ struct object_entry *packlist_alloc(struct packing_data *pdata,
 
 void oe_set_delta_ext(struct packing_data *pdata,
                      struct object_entry *delta,
-                     const unsigned char *sha1)
+                     const struct object_id *oid)
 {
        struct object_entry *base;
 
        ALLOC_GROW(pdata->ext_bases, pdata->nr_ext + 1, pdata->alloc_ext);
        base = &pdata->ext_bases[pdata->nr_ext++];
        memset(base, 0, sizeof(*base));
-       hashcpy(base->idx.oid.hash, sha1);
+       oidcpy(&base->idx.oid, oid);
 
        /* These flags mark that we are not part of the actual pack output. */
        base->preferred_base = 1;