alloc: add repository argument to alloc_tree_node
[gitweb.git] / tree.c
diff --git a/tree.c b/tree.c
index 1a0f03f5207a4cd85da5540edc5be593ff37e829..58cf19b4fa8e77a25cf64b4316f429d59978c33e 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -196,7 +196,8 @@ struct tree *lookup_tree(const struct object_id *oid)
 {
        struct object *obj = lookup_object(oid->hash);
        if (!obj)
-               return create_object(oid->hash, alloc_tree_node());
+               return create_object(the_repository, oid->hash,
+                                    alloc_tree_node(the_repository));
        return object_as_type(obj, OBJ_TREE, 0);
 }
 
@@ -219,7 +220,7 @@ int parse_tree_gently(struct tree *item, int quiet_on_missing)
 
        if (item->object.parsed)
                return 0;
-       buffer = read_sha1_file(item->object.oid.hash, &type, &size);
+       buffer = read_object_file(&item->object.oid, &type, &size);
        if (!buffer)
                return quiet_on_missing ? -1 :
                        error("Could not read %s",