Skip to content

Commit 5da6534

Browse files
stefanbellergitster
authored andcommitted
packfile: add repository argument to read_object
Add a repository argument to allow the callers of read_object to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Stefan Beller <[email protected]> Reviewed-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 720aaa1 commit 5da6534

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packfile.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,8 +1469,10 @@ struct unpack_entry_stack_ent {
14691469
unsigned long size;
14701470
};
14711471

1472-
static void *read_object(const struct object_id *oid, enum object_type *type,
1473-
unsigned long *size)
1472+
#define read_object(r, o, t, s) read_object_##r(o, t, s)
1473+
static void *read_object_the_repository(const struct object_id *oid,
1474+
enum object_type *type,
1475+
unsigned long *size)
14741476
{
14751477
struct object_info oi = OBJECT_INFO_INIT;
14761478
void *content;
@@ -1614,7 +1616,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
16141616
oid_to_hex(&base_oid), (uintmax_t)obj_offset,
16151617
p->pack_name);
16161618
mark_bad_packed_object(p, base_oid.hash);
1617-
base = read_object(&base_oid, &type, &base_size);
1619+
base = read_object(the_repository, &base_oid, &type, &base_size);
16181620
external_base = base;
16191621
}
16201622
}

0 commit comments

Comments
 (0)