From 38a12c2ddde5188bbbd04501883b7092745b0dac Mon Sep 17 00:00:00 2001 From: patrick-scho Date: Mon, 1 Dec 2025 15:27:49 +0100 Subject: changes --- ui-tree.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ui-tree.c') 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("\n"); } -static void ls_tail(const struct object_id *oid) +static void ls_tail(const struct tree *tree) { html("\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(); -- cgit v1.2.3