Skip to content

Commit 589de91

Browse files
stefanbellergitster
authored andcommitted
packfile: add repository argument to cache_or_unpack_entry
Add a repository argument to allow the callers of cache_or_unpack_entry 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: Jonathan Nieder <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Reviewed-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 57a6a50 commit 589de91

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packfile.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,8 @@ static void detach_delta_base_cache_entry(struct delta_base_cache_entry *ent)
12721272
free(ent);
12731273
}
12741274

1275-
static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,
1275+
#define cache_or_unpack_entry(r, p, bo, bs, t) cache_or_unpack_entry_##r(p, bo, bs, t)
1276+
static void *cache_or_unpack_entry_the_repository(struct packed_git *p, off_t base_offset,
12761277
unsigned long *base_size, enum object_type *type)
12771278
{
12781279
struct delta_base_cache_entry *ent;
@@ -1346,7 +1347,7 @@ int packed_object_info_the_repository(struct packed_git *p, off_t obj_offset,
13461347
* a "real" type later if the caller is interested.
13471348
*/
13481349
if (oi->contentp) {
1349-
*oi->contentp = cache_or_unpack_entry(p, obj_offset, oi->sizep,
1350+
*oi->contentp = cache_or_unpack_entry(the_repository, p, obj_offset, oi->sizep,
13501351
&type);
13511352
if (!*oi->contentp)
13521353
type = OBJ_BAD;

0 commit comments

Comments
 (0)