@matheusbsbs / matheus-bagliano / commits / 8d5cf95735
Fork 0

pack-objects: refactor to oid_object_info_extended

Use oid_object_info_extended() instead of oid_object_info() because a subsequent commit needs to specify an additional flag here. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Jul 20, 2020 at 17:21 UTC 8d5cf957352badca4575cc85c020d6cf73db86f7
1 file changed +6 -2
builtin/pack-objects.c
+6 -2
@@ -1707,6 +1707,8 @@ static int can_reuse_delta(const struct object_id *base_oid,
1707 static void check_object(struct object_entry *entry)
1708 {
1709 unsigned long canonical_size;
1710 + enum object_type type;
1711 + struct object_info oi = {.typep = &type, .sizep = &canonical_size};
1712
1713 if (IN_PACK(entry)) {
1714 struct packed_git *p = IN_PACK(entry);
@@ -1840,8 +1842,10 @@ static void check_object(struct object_entry *entry)
1842 unuse_pack(&w_curs);
1843 }
1844
1843 - oe_set_type(entry,
1844 - oid_object_info(the_repository, &entry->idx.oid, &canonical_size));
1845 + if (oid_object_info_extended(the_repository, &entry->idx.oid, &oi,
1846 + OBJECT_INFO_LOOKUP_REPLACE) < 0)
1847 + type = -1;
1848 + oe_set_type(entry, type);
1849 if (entry->type_valid) {
1850 SET_SIZE(entry, canonical_size);
1851 } else {