From 63aa2ecd4e72800c11b08e4fb94234a117ece029 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 27 Sep 2026 22:04:58 +0300 Subject: ui-summary: (THEME) Rework what is shown in summary page Now clone and branches are shown next to commits and tags, branches only show name and age, clone does not create links, and file listing (alongside readme) is shown below --- ui-tree.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index 27cbd46..9616e33 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -431,3 +431,44 @@ void cgit_print_tree(const char *rev, char *path) cleanup: free(walk_tree_ctx.curr_rev); } + +void cgit_print_tree_component(const char *rev, char *path) +{ + struct object_id oid; + struct commit *commit; + struct walk_tree_context walk_tree_ctx = { + .match_path = path, + .state = 0 + }; + struct tree *tree; + struct pathspec paths = { + .nr = 0 + }; + + if (!rev) + rev = ctx.qry.head; + + if (path != NULL || repo_get_oid(the_repository, rev, &oid)) + return; + + commit = lookup_commit_reference(the_repository, &oid); + if (!commit || repo_parse_commit(the_repository, commit)) + return; + + walk_tree_ctx.curr_rev = xstrdup(rev); + + tree = parse_tree_indirect(get_commit_tree_oid(commit)); + if (tree) { + html("\n"); + html(""); + html(""); + html(""); + html("\n"); + read_tree(the_repository, tree, &paths, ls_item, &walk_tree_ctx); + html("
NameSize"); + html("
\n"); + cgit_print_repo_readme_component(ctx.qry.path); + } + + free(walk_tree_ctx.curr_rev); +} -- cgit v1.3.1-23-gd82d