abouttreesummaryrefslogcommitdiff
path: root/ui-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-tree.c')
-rw-r--r--ui-tree.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ui-tree.c b/ui-tree.c
index 9cbed30..5e78f64 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -274,11 +274,11 @@ static void ls_head(void)
html("</tr>\n");
}
-static void ls_tail(const struct object_id *oid)
+static void ls_tail(const struct tree *tree)
{
html("</table>\n");
- if (oid)
- cgit_print_repo_readme_no_layout(oid);
+ if (tree)
+ cgit_print_repo_readme_no_layout(tree);
cgit_print_layout_end();
}
@@ -299,7 +299,7 @@ static void ls_tree(const struct object_id *oid, const char *path, struct walk_t
ls_head();
read_tree_recursive(the_repository, tree, "", 0, 1,
&paths, ls_item, walk_tree_ctx);
- ls_tail(oid);
+ ls_tail(tree);
}
@@ -377,12 +377,13 @@ void cgit_print_tree(const char *rev, char *path)
goto cleanup;
}
+ const struct tree *tree = repo_get_commit_tree(the_repository, commit);
read_tree_recursive(the_repository,
- repo_get_commit_tree(the_repository, commit),
+ tree,
"", 0, 0,
&paths, walk_tree, &walk_tree_ctx);
if (walk_tree_ctx.state == 1) {
- ls_tail(NULL);
+ ls_tail(tree);
}
else if (walk_tree_ctx.state == 2) {
cgit_print_layout_end();