summary refs log tree commit diff
diff options
context:
space:
mode:
authorequa <equaa@protonmail.com>2022-01-06 19:08:08 -0600
committerequa <equaa@protonmail.com>2022-01-06 19:08:08 -0600
commitb39585417ac47c6c1612ebb2488f3fd5369f7ef7 (patch)
treeaf30bf582af0bc87ab8a561d1e4d93479d59aef4
parent99c81764f66c0877a7ed66f5a03d52f948377678 (diff)
default-tab: don't remove urls in links with extra information
fixes tree view

Signed-off-by: equa <equaa@protonmail.com>
-rw-r--r--ui-shared.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ui-shared.c b/ui-shared.c
index c0710fa..f0ee3ee 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -320,12 +320,10 @@ static void reporevlink(const char *page, const char *name, const char *title,
 {
 	char *delim;
 
-	if (!strcmp(page
-	            ? page
-	            : "",
-	            ctx.repo
-	            ? ctx.repo->default_tab
-	            : ctx.cfg.root_default_tab))
+	if (page
+	    && !rev
+	    && !path
+	    && !strcmp(page, ctx.repo->default_tab))
 		page = NULL;
 
 	delim = repolink(title, class, page, head, path);
@@ -349,7 +347,13 @@ void cgit_repo_link(const char *name, const char *title, const char *class,
 void cgit_summary_link(const char *name, const char *title, const char *class,
 		       const char *head)
 {
-	reporevlink("summary", name, title, class, head, NULL, NULL);
+	if (!strcmp("summary",
+	            ctx.repo
+	            ? ctx.repo->default_tab
+	            : ctx.cfg.default_tab))
+	    reporevlink(NULL, name, title, class, head, NULL, NULL);
+	else
+	    reporevlink("summary", name, title, class, head, NULL, NULL);
 }
 
 void cgit_tag_link(const char *name, const char *title, const char *class,