about summary refs log tree commit diff stats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorJohn Keeping2015-01-15 22:18:14 +0000
committerJason A. Donenfeld2015-01-19 17:52:10 +0100
commitc422b9b3d5938a4d386533604d4c0dbedfcb2b6d (patch)
treedf512e44809bf0e34ca80a8d57a6fc74482007d9 /ui-shared.c
parentReturn proper HTTP response when accessing info/ (diff)
downloadcgit-c422b9b3d5938a4d386533604d4c0dbedfcb2b6d.tar.gz
cgit-c422b9b3d5938a4d386533604d4c0dbedfcb2b6d.zip
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 <mailings@hupie.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c8
1 files changed, 4 insertions, 4 deletions
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,
273} 273}
274 274
275void cgit_tag_link(const char *name, const char *title, const char *class, 275void cgit_tag_link(const char *name, const char *title, const char *class,
276 const char *head, const char *rev) 276 const char *tag)
277{ 277{
278 reporevlink("tag", name, title, class, head, rev, NULL); 278 reporevlink("tag", name, title, class, tag, NULL, NULL);
279} 279}
280 280
281void cgit_tree_link(const char *name, const char *title, const char *class, 281void 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)
443 else if (!strcmp(ctx.qry.page, "summary")) 443 else if (!strcmp(ctx.qry.page, "summary"))
444 cgit_summary_link(name, title, class, ctx.qry.head); 444 cgit_summary_link(name, title, class, ctx.qry.head);
445 else if (!strcmp(ctx.qry.page, "tag")) 445 else if (!strcmp(ctx.qry.page, "tag"))
446 cgit_tag_link(name, title, class, ctx.qry.head, 446 cgit_tag_link(name, title, class, ctx.qry.has_sha1 ?
447 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL); 447 ctx.qry.sha1 : ctx.qry.head);
448 else if (!strcmp(ctx.qry.page, "tree")) 448 else if (!strcmp(ctx.qry.page, "tree"))
449 cgit_tree_link(name, title, class, ctx.qry.head, 449 cgit_tree_link(name, title, class, ctx.qry.head,
450 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, 450 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,