sha1_file: teach sha1_object_info_extended more flags
[gitweb.git] / tree.c
diff --git a/tree.c b/tree.c
index 21fd80b801aec559cdc88d8b9e7fc88054b8a6be..603b29ee805b00c4b1eeeebed51c917bfef7c009 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -110,7 +110,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
                len = tree_entry_len(&entry);
                strbuf_add(base, entry.path, len);
                strbuf_addch(base, '/');
-               retval = read_tree_1(lookup_tree(oid.hash),
+               retval = read_tree_1(lookup_tree(&oid),
                                     base, stage, pathspec,
                                     fn, context);
                strbuf_setlen(base, oldlen);
@@ -184,11 +184,11 @@ int read_tree(struct tree *tree, int stage, struct pathspec *match)
        return 0;
 }
 
-struct tree *lookup_tree(const unsigned char *sha1)
+struct tree *lookup_tree(const struct object_id *oid)
 {
-       struct object *obj = lookup_object(sha1);
+       struct object *obj = lookup_object(oid->hash);
        if (!obj)
-               return create_object(sha1, alloc_tree_node());
+               return create_object(oid->hash, alloc_tree_node());
        return object_as_type(obj, OBJ_TREE, 0);
 }
 
@@ -232,9 +232,9 @@ void free_tree_buffer(struct tree *tree)
        tree->object.parsed = 0;
 }
 
-struct tree *parse_tree_indirect(const unsigned char *sha1)
+struct tree *parse_tree_indirect(const struct object_id *oid)
 {
-       struct object *obj = parse_object(sha1);
+       struct object *obj = parse_object(oid);
        do {
                if (!obj)
                        return NULL;
@@ -247,6 +247,6 @@ struct tree *parse_tree_indirect(const unsigned char *sha1)
                else
                        return NULL;
                if (!obj->parsed)
-                       parse_object(obj->oid.hash);
+                       parse_object(&obj->oid);
        } while (1);
 }