]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-objects: convert oe_set_delta_ext() to use object_id
authorJeff King <peff@peff.net>
Mon, 24 Feb 2020 04:30:07 +0000 (23:30 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2020 20:55:52 +0000 (12:55 -0800)
We already store an object_id internally, and now our sole caller also
has one. Let's stop passing around the internal hash array, which adds a
bit of type safety.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
pack-objects.c
pack-objects.h

index 8692ab3fe698ea85ba276c59b7161c882efadbe5..44f44fcb1a43352d23d38f06bd71b51ec0db49c2 100644 (file)
@@ -1756,7 +1756,7 @@ static void check_object(struct object_entry *entry)
                                entry->delta_sibling_idx = base_entry->delta_child_idx;
                                SET_DELTA_CHILD(base_entry, entry);
                        } else {
-                               SET_DELTA_EXT(entry, base_ref.hash);
+                               SET_DELTA_EXT(entry, &base_ref);
                        }
 
                        unuse_pack(&w_curs);
index 5e5a3c62d9db8cf11b4c64c196ae0fb830fe5004..f2a433885ac80ec9cbadfd3e5e7553655237c924 100644 (file)
@@ -203,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;
index d3975e079b1060c5dc0b5b1dda2b9e921a632730..9d88e3e518f06245ae6278e14efd14a21e1b44ba 100644 (file)
@@ -292,7 +292,7 @@ static inline void oe_set_delta(struct packing_data *pack,
 
 void oe_set_delta_ext(struct packing_data *pack,
                      struct object_entry *e,
-                     const unsigned char *sha1);
+                     const struct object_id *oid);
 
 static inline struct object_entry *oe_delta_child(
                const struct packing_data *pack,