From 1a66e7f3c15bf8d0d5d1b198c6674911a213779e Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Mon, 12 Sep 2016 22:54:08 -0500 Subject: ui-repolist: Allow sections to be collapsible The index page can be difficult to navigate for really large git servers. This change allows a configuration like: section-collapse=people section-collapse=tests And an index page would only display the "people" and "tests" section headers entries (not their repos) with a hyperlink that can be used to drill down into each section. Additionally the boolean logic around displaying sections in ui-repolist.c was simplified to eliminate an impossible condition. Signed-off-by: Andy Doan Reviewed-by: John Keeping Signed-off-by: John Keeping --- scan-tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scan-tree.c') diff --git a/scan-tree.c b/scan-tree.c index 1cb4e5d..fa21fc4 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -164,10 +164,10 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn) } if (slash && !n) { *slash = '\0'; - repo->section = xstrdup(rel.buf); + repo->section = get_or_create_section(rel.buf); *slash = '/'; - if (starts_with(repo->name, repo->section)) { - repo->name += strlen(repo->section); + if (starts_with(repo->name, repo->section->name)) { + repo->name += strlen(repo->section->name); if (*repo->name == '/') repo->name++; } -- cgit v1.2.3