object: add repository argument to object_as_type
[gitweb.git] / object.c
index 9b0f819fae38bcc2fe6b15bfe8e5b9b17f7385bc..404919043d478ead8e6a1c894c4474fe068150b9 100644 (file)
--- a/object.c
+++ b/object.c
@@ -84,7 +84,7 @@ static void insert_obj_hash(struct object *obj, struct object **hash, unsigned i
  * Look up the record for the given sha1 in the hash map stored in
  * obj_hash.  Return NULL if it was not found.
  */
-struct object *lookup_object(const unsigned char *sha1)
+struct object *lookup_object_the_repository(const unsigned char *sha1)
 {
        unsigned int i, first;
        struct object *obj;
@@ -158,7 +158,7 @@ void *create_object(struct repository *r, const unsigned char *sha1, void *o)
        return obj;
 }
 
-void *object_as_type(struct object *obj, enum object_type type, int quiet)
+void *object_as_type_the_repository(struct object *obj, enum object_type type, int quiet)
 {
        if (obj->type == type)
                return obj;
@@ -179,14 +179,14 @@ void *object_as_type(struct object *obj, enum object_type type, int quiet)
 
 struct object *lookup_unknown_object(const unsigned char *sha1)
 {
-       struct object *obj = lookup_object(sha1);
+       struct object *obj = lookup_object(the_repository, sha1);
        if (!obj)
                obj = create_object(the_repository, sha1,
                                    alloc_object_node(the_repository));
        return obj;
 }
 
-struct object *parse_object_buffer(const struct object_id *oid, enum object_type type, unsigned long size, void *buffer, int *eaten_p)
+struct object *parse_object_buffer_the_repository(const struct object_id *oid, enum object_type type, unsigned long size, void *buffer, int *eaten_p)
 {
        struct object *obj;
        *eaten_p = 0;
@@ -239,14 +239,14 @@ struct object *parse_object_buffer(const struct object_id *oid, enum object_type
 struct object *parse_object_or_die(const struct object_id *oid,
                                   const char *name)
 {
-       struct object *o = parse_object(oid);
+       struct object *o = parse_object(the_repository, oid);
        if (o)
                return o;
 
        die(_("unable to parse object: %s"), name ? name : oid_to_hex(oid));
 }
 
-struct object *parse_object(const struct object_id *oid)
+struct object *parse_object_the_repository(const struct object_id *oid)
 {
        unsigned long size;
        enum object_type type;
@@ -255,7 +255,7 @@ struct object *parse_object(const struct object_id *oid)
        void *buffer;
        struct object *obj;
 
-       obj = lookup_object(oid->hash);
+       obj = lookup_object(the_repository, oid->hash);
        if (obj && obj->parsed)
                return obj;
 
@@ -267,7 +267,7 @@ struct object *parse_object(const struct object_id *oid)
                        return NULL;
                }
                parse_blob_buffer(lookup_blob(oid), NULL, 0);
-               return lookup_object(oid->hash);
+               return lookup_object(the_repository, oid->hash);
        }
 
        buffer = read_object_file(oid, &type, &size);
@@ -278,7 +278,8 @@ struct object *parse_object(const struct object_id *oid)
                        return NULL;
                }
 
-               obj = parse_object_buffer(oid, type, size, buffer, &eaten);
+               obj = parse_object_buffer(the_repository, oid, type, size,
+                                         buffer, &eaten);
                if (!eaten)
                        free(buffer);
                return obj;