Skip to content

Commit 8d5cf95

Browse files
jonathantanmygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cfa7ae8 commit 8d5cf95

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

builtin/pack-objects.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,8 @@ static int can_reuse_delta(const struct object_id *base_oid,
17071707
static void check_object(struct object_entry *entry)
17081708
{
17091709
unsigned long canonical_size;
1710+
enum object_type type;
1711+
struct object_info oi = {.typep = &type, .sizep = &canonical_size};
17101712

17111713
if (IN_PACK(entry)) {
17121714
struct packed_git *p = IN_PACK(entry);
@@ -1840,8 +1842,10 @@ static void check_object(struct object_entry *entry)
18401842
unuse_pack(&w_curs);
18411843
}
18421844

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);
18451849
if (entry->type_valid) {
18461850
SET_SIZE(entry, canonical_size);
18471851
} else {

0 commit comments

Comments
 (0)