summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:16 (GMT)
commitfcb6df325468a7ae12949ab80dcd37772b9b1fbf (patch)
tree7ae13a8a1c4f7b417403b6f7f64f34a9565dbab2 /builtin/pack-objects.c
parentd0f7b22b5bf0847a6e0fe039feb598819dffab4c (diff)
parent9d98354f48997faf8251c566d909957f6ae427d5 (diff)
downloadgit-fcb6df325468a7ae12949ab80dcd37772b9b1fbf.zip
git-fcb6df325468a7ae12949ab80dcd37772b9b1fbf.tar.gz
git-fcb6df325468a7ae12949ab80dcd37772b9b1fbf.tar.bz2
Merge branch 'sb/oid-object-info'
The codepath around object-info API has been taught to take the repository object (which in turn tells the API which object store the objects are to be located). * sb/oid-object-info: cache.h: allow oid_object_info to handle arbitrary repositories packfile: add repository argument to cache_or_unpack_entry packfile: add repository argument to unpack_entry packfile: add repository argument to read_object packfile: add repository argument to packed_object_info packfile: add repository argument to packed_to_object_type packfile: add repository argument to retry_bad_packed_offset cache.h: add repository argument to oid_object_info cache.h: add repository argument to oid_object_info_extended
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0bfd33e..4ce6a93 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1521,7 +1521,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
@@ -1576,14 +1577,16 @@ static void drop_reused_delta(struct object_entry *entry)
oi.sizep = &entry->size;
oi.typep = &entry->type;
- if (packed_object_info(entry->in_pack, entry->in_pack_offset, &oi) < 0) {
+ if (packed_object_info(the_repository, entry->in_pack,
+ entry->in_pack_offset, &oi) < 0) {
/*
* We failed to get the info from this pack for some reason;
* fall back to sha1_object_info, which may find another copy.
* 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);
}
}
@@ -2717,7 +2720,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);