diff options
author | Stefan Beller <sbeller@google.com> | 2018-04-25 11:20:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-26 10:54:27 +0900 |
commit | 0df8e96566ddcae4adc4efc096944c064f60b8bd (patch) | |
tree | 19c8b0277b21dcd9a9baa71ca5541bd59853afae /builtin/pack-objects.c | |
parent | cache.h: add repository argument to oid_object_info_extended (diff) | |
download | tgif-0df8e96566ddcae4adc4efc096944c064f60b8bd.tar.xz |
cache.h: add repository argument to oid_object_info
Add a repository argument to allow the callers of oid_object_info
to be more specific about which repository to handle. 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 <sbeller@google.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r-- | builtin/pack-objects.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 4bdae5a1d8..8d4111f748 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -1516,7 +1516,8 @@ static void check_object(struct object_entry *entry) unuse_pack(&w_curs); } - entry->type = oid_object_info(&entry->idx.oid, &entry->size); + entry->type = oid_object_info(the_repository, &entry->idx.oid, + &entry->size); /* * The error condition is checked in prepare_pack(). This is * to permit a missing preferred base object to be ignored @@ -1578,7 +1579,8 @@ static void drop_reused_delta(struct object_entry *entry) * And if that fails, the error will be recorded in entry->type * and dealt with in prepare_pack(). */ - entry->type = oid_object_info(&entry->idx.oid, &entry->size); + entry->type = oid_object_info(the_repository, &entry->idx.oid, + &entry->size); } } @@ -2706,7 +2708,7 @@ static void add_objects_in_unpacked_packs(struct rev_info *revs) static int add_loose_object(const struct object_id *oid, const char *path, void *data) { - enum object_type type = oid_object_info(oid, NULL); + enum object_type type = oid_object_info(the_repository, oid, NULL); if (type < 0) { warning("loose object at %s could not be examined", path); |