summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-11-14 00:12:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-14 08:22:40 (GMT)
commitd1a69022650bbb6a56ebe93a28fe8b0e6a8d7fa7 (patch)
treea352d397f6fc65dd509552968a5e7b03dc68135a /object.c
parent9b45f499818f505f8f7797c6d8f63a3bdccfa95f (diff)
downloadgit-d1a69022650bbb6a56ebe93a28fe8b0e6a8d7fa7.zip
git-d1a69022650bbb6a56ebe93a28fe8b0e6a8d7fa7.tar.gz
git-d1a69022650bbb6a56ebe93a28fe8b0e6a8d7fa7.tar.bz2
object: parse_object to honor its repository argument
In 8e4b0b6047 (object.c: allow parse_object to handle arbitrary repositories, 2018-06-28), we forgot to pass the repository down to the read_object_file. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/object.c b/object.c
index e541605..003f870 100644
--- a/object.c
+++ b/object.c
@@ -259,8 +259,8 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
if (obj && obj->parsed)
return obj;
- if ((obj && obj->type == OBJ_BLOB && has_object_file(oid)) ||
- (!obj && has_object_file(oid) &&
+ if ((obj && obj->type == OBJ_BLOB && repo_has_object_file(r, oid)) ||
+ (!obj && repo_has_object_file(r, oid) &&
oid_object_info(r, oid, NULL) == OBJ_BLOB)) {
if (check_object_signature(repl, NULL, 0, NULL) < 0) {
error(_("sha1 mismatch %s"), oid_to_hex(oid));
@@ -270,7 +270,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
return lookup_object(r, oid->hash);
}
- buffer = read_object_file(oid, &type, &size);
+ buffer = repo_read_object_file(r, oid, &type, &size);
if (buffer) {
if (check_object_signature(repl, buffer, size, type_name(type)) < 0) {
free(buffer);