diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-05-23 14:38:16 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-23 14:38:16 +0900 |
commit | fcb6df325468a7ae12949ab80dcd37772b9b1fbf (patch) | |
tree | 7ae13a8a1c4f7b417403b6f7f64f34a9565dbab2 /fast-import.c | |
parent | d0f7b22b5bf0847a6e0fe039feb598819dffab4c (diff) | |
parent | 9d98354f48997faf8251c566d909957f6ae427d5 (diff) | |
download | git-fcb6df325468a7ae12949ab80dcd37772b9b1fbf.tar.gz |
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 'fast-import.c')
-rw-r--r-- | fast-import.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fast-import.c b/fast-import.c index 34edf3fb8f..b2338fa8eb 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1331,7 +1331,7 @@ static void *gfi_unpack_entry( */ p->pack_size = pack_size + the_hash_algo->rawsz; } - return unpack_entry(p, oe->idx.offset, &type, sizep); + return unpack_entry(the_repository, p, oe->idx.offset, &type, sizep); } static const char *get_mode(const char *str, uint16_t *modep) @@ -1872,7 +1872,8 @@ static void read_marks(void) die("corrupt mark line: %s", line); e = find_object(&oid); if (!e) { - enum object_type type = oid_object_info(&oid, NULL); + enum object_type type = oid_object_info(the_repository, + &oid, NULL); if (type < 0) die("object not found: %s", oid_to_hex(&oid)); e = insert_object(&oid); @@ -2402,7 +2403,8 @@ static void file_change_m(const char *p, struct branch *b) enum object_type expected = S_ISDIR(mode) ? OBJ_TREE: OBJ_BLOB; enum object_type type = oe ? oe->type : - oid_object_info(&oid, NULL); + oid_object_info(the_repository, &oid, + NULL); if (type < 0) die("%s not found: %s", S_ISDIR(mode) ? "Tree" : "Blob", @@ -2563,7 +2565,8 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa die("Not a blob (actually a %s): %s", type_name(oe->type), command_buf.buf); } else if (!is_null_oid(&oid)) { - enum object_type type = oid_object_info(&oid, NULL); + enum object_type type = oid_object_info(the_repository, &oid, + NULL); if (type < 0) die("Blob not found: %s", command_buf.buf); if (type != OBJ_BLOB) @@ -2850,7 +2853,7 @@ static void parse_new_tag(const char *arg) } else if (!get_oid(from, &oid)) { struct object_entry *oe = find_object(&oid); if (!oe) { - type = oid_object_info(&oid, NULL); + type = oid_object_info(the_repository, &oid, NULL); if (type < 0) die("Not a valid object: %s", from); } else @@ -3008,7 +3011,8 @@ static struct object_entry *dereference(struct object_entry *oe, unsigned long size; char *buf = NULL; if (!oe) { - enum object_type type = oid_object_info(oid, NULL); + enum object_type type = oid_object_info(the_repository, oid, + NULL); if (type < 0) die("object not found: %s", oid_to_hex(oid)); /* cache it! */ |