@@ -340,7 +340,8 @@ void free_commit_buffer(struct parsed_object_pool *pool, struct commit *commit)
}
}
-struct tree *get_commit_tree(const struct commit *commit)
+struct tree *repo_get_commit_tree(struct repository *r,
+ const struct commit *commit)
{
if (commit->maybe_tree || !commit->object.parsed)
return commit->maybe_tree;
@@ -348,7 +349,7 @@ struct tree *get_commit_tree(const struct commit *commit)
if (commit->graph_pos == COMMIT_NOT_FROM_GRAPH)
BUG("commit has NULL tree, but was not loaded from commit-graph");
- return get_commit_tree_in_graph(the_repository, commit);
+ return get_commit_tree_in_graph(r, commit);
}
struct object_id *get_commit_tree_oid(const struct commit *commit)
@@ -143,7 +143,8 @@ void repo_unuse_commit_buffer(struct repository *r,
*/
void free_commit_buffer(struct parsed_object_pool *pool, struct commit *);
-struct tree *get_commit_tree(const struct commit *);
+struct tree *repo_get_commit_tree(struct repository *, const struct commit *);
+#define get_commit_tree(c) repo_get_commit_tree(the_repository, c)
struct object_id *get_commit_tree_oid(const struct commit *);
/*
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> --- commit.c | 5 +++-- commit.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)