From c422b9b3d5938a4d386533604d4c0dbedfcb2b6d Mon Sep 17 00:00:00 2001 From: John Keeping Date: Thu, 15 Jan 2015 22:18:14 +0000 Subject: tag: reference with "h" instead of "id" When clicking on "log" from a tag we end up showing the log of whatever branch we used to reach the tag. If the tag doesn't point onto a branch then the tagged commit won't appear in this output. By linking to tags with the head parameter instead of the "id" parameter the log link will show the log of the tag. This is clearly desirable when the tag has been reached from the refs UI and changing the behaviour for tag decorations makes them match branch decorations where log -> decoration -> log shows the log of the decoration. Reported-by: Ferry Huberts Signed-off-by: John Keeping --- ui-shared.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 32f23f9..d8cc4d7 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -273,9 +273,9 @@ void cgit_summary_link(const char *name, const char *title, const char *class, } void cgit_tag_link(const char *name, const char *title, const char *class, - const char *head, const char *rev) + const char *tag) { - reporevlink("tag", name, title, class, head, rev, NULL); + reporevlink("tag", name, title, class, tag, NULL, NULL); } void cgit_tree_link(const char *name, const char *title, const char *class, @@ -443,8 +443,8 @@ static void cgit_self_link(char *name, const char *title, const char *class) else if (!strcmp(ctx.qry.page, "summary")) cgit_summary_link(name, title, class, ctx.qry.head); else if (!strcmp(ctx.qry.page, "tag")) - cgit_tag_link(name, title, class, ctx.qry.head, - ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL); + cgit_tag_link(name, title, class, ctx.qry.has_sha1 ? + ctx.qry.sha1 : ctx.qry.head); else if (!strcmp(ctx.qry.page, "tree")) cgit_tree_link(name, title, class, ctx.qry.head, ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, -- cgit v1.2.3