packfile: add repository argument to unpack_entry

Add a repository argument to allow the callers of 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 <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller
2018-04-25 11:21:04 -07:00
committed by Junio C Hamano
parent 5da6534dd6
commit 57a6a500be
4 changed files with 9 additions and 6 deletions

View File

@ -1279,7 +1279,7 @@ static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,
ent = get_delta_base_cache_entry(p, base_offset);
if (!ent)
return unpack_entry(p, base_offset, type, base_size);
return unpack_entry(the_repository, p, base_offset, type, base_size);
if (type)
*type = ent->type;
@ -1485,8 +1485,9 @@ static void *read_object_the_repository(const struct object_id *oid,
return content;
}
void *unpack_entry(struct packed_git *p, off_t obj_offset,
enum object_type *final_type, unsigned long *final_size)
void *unpack_entry_the_repository(struct packed_git *p, off_t obj_offset,
enum object_type *final_type,
unsigned long *final_size)
{
struct pack_window *w_curs = NULL;
off_t curpos = obj_offset;