summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-04-25 18:20:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-26 01:54:27 (GMT)
commit0df8e96566ddcae4adc4efc096944c064f60b8bd (patch)
tree19c8b0277b21dcd9a9baa71ca5541bd59853afae /fast-import.c
parent7ecd8690602170f0993923c99645c7c6005e3dfa (diff)
downloadgit-0df8e96566ddcae4adc4efc096944c064f60b8bd.zip
git-0df8e96566ddcae4adc4efc096944c064f60b8bd.tar.gz
git-0df8e96566ddcae4adc4efc096944c064f60b8bd.tar.bz2
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 'fast-import.c')
-rw-r--r--fast-import.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fast-import.c b/fast-import.c
index 99f8f56..afe06bd 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1917,7 +1917,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);
@@ -2447,7 +2448,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",
@@ -2608,7 +2610,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)
@@ -2895,7 +2898,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
@@ -3053,7 +3056,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! */