commit-reach.c: allow get_merge_bases_many_0 to handle any repo
[gitweb.git] / object.c
index 51c45945156c421ada403139faefdf145918f4f7..003f8704844c5a6c70b719d87494e535719de044 100644 (file)
--- a/object.c
+++ b/object.c
@@ -95,7 +95,7 @@ struct object *lookup_object(struct repository *r, const unsigned char *sha1)
 
        first = i = hash_obj(sha1, r->parsed_objects->obj_hash_size);
        while ((obj = r->parsed_objects->obj_hash[i]) != NULL) {
-               if (!hashcmp(sha1, obj->oid.hash))
+               if (hasheq(sha1, obj->oid.hash))
                        break;
                i++;
                if (i == r->parsed_objects->obj_hash_size)
@@ -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);