summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 45105dc..1418010 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -251,48 +251,51 @@ void cgit_diff_link(char *name, char *title, char *class, char *head,
html_attr(new_rev);
delim = "&";
}
if (old_rev) {
html(delim);
html("id2=");
html_attr(old_rev);
}
html("'>");
html_txt(name);
html("</a>");
}
void cgit_object_link(struct object *obj)
{
char *page, *arg, *url;
if (obj->type == OBJ_COMMIT) {
cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL,
cgit_query_head, sha1_to_hex(obj->sha1));
return;
} else if (obj->type == OBJ_TREE) {
page = "tree";
arg = "id";
+ } else if (obj->type == OBJ_TAG) {
+ page = "tag";
+ arg = "id";
} else {
page = "blob";
arg = "id";
}
url = cgit_pageurl(cgit_query_repo, page,
fmt("%s=%s", arg, sha1_to_hex(obj->sha1)));
html_link_open(url, NULL, NULL);
htmlf("%s %s", typename(obj->type),
sha1_to_hex(obj->sha1));
html_link_close();
}
void cgit_print_date(time_t secs, char *format)
{
char buf[64];
struct tm *time;
time = gmtime(&secs);
strftime(buf, sizeof(buf)-1, format, time);
html_txt(buf);
}
void cgit_print_age(time_t t, time_t max_relative, char *format)