aboutsummaryrefslogtreecommitdiffstats
path: root/odb.c
diff options
context:
space:
mode:
Diffstat (limited to 'odb.c')
-rw-r--r--odb.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/odb.c b/odb.c
index 217903d7b1..1f48a0448e 100644
--- a/odb.c
+++ b/odb.c
@@ -905,11 +905,11 @@ void *odb_read_object(struct object_database *odb,
return data;
}
-void *read_object_with_reference(struct repository *r,
- const struct object_id *oid,
- enum object_type required_type,
- unsigned long *size,
- struct object_id *actual_oid_return)
+void *odb_read_object_peeled(struct object_database *odb,
+ const struct object_id *oid,
+ enum object_type required_type,
+ unsigned long *size,
+ struct object_id *actual_oid_return)
{
enum object_type type;
void *buffer;
@@ -921,7 +921,7 @@ void *read_object_with_reference(struct repository *r,
int ref_length = -1;
const char *ref_type = NULL;
- buffer = odb_read_object(r->objects, &actual_oid, &type, &isize);
+ buffer = odb_read_object(odb, &actual_oid, &type, &isize);
if (!buffer)
return NULL;
if (type == required_type) {
@@ -941,9 +941,10 @@ void *read_object_with_reference(struct repository *r,
}
ref_length = strlen(ref_type);
- if (ref_length + r->hash_algo->hexsz > isize ||
+ if (ref_length + odb->repo->hash_algo->hexsz > isize ||
memcmp(buffer, ref_type, ref_length) ||
- get_oid_hex_algop((char *) buffer + ref_length, &actual_oid, r->hash_algo)) {
+ get_oid_hex_algop((char *) buffer + ref_length, &actual_oid,
+ odb->repo->hash_algo)) {
free(buffer);
return NULL;
}