]>
git.cameronkatri.com Git - cgit.git/blob - ui-tag.c
1 /* ui-tag.c: display a tag
3 * Copyright (C) 2007 Lars Hjemli
5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text)
12 static void print_tag_content(char *buf
)
19 html("<div class='commit-subject'>");
20 p
= strchr(buf
, '\n');
26 html("<div class='commit-msg'>");
32 void cgit_print_tag(char *revname
)
34 unsigned char sha1
[20];
39 if (get_sha1(revname
, sha1
)) {
40 cgit_print_error(fmt("Bad tag reference: %s", revname
));
43 obj
= parse_object(sha1
);
45 cgit_print_error(fmt("Bad object id: %s", sha1_to_hex(sha1
)));
48 if (obj
->type
== OBJ_TAG
) {
49 tag
= lookup_tag(sha1
);
50 if (!tag
|| parse_tag(tag
) || !(info
= cgit_parse_tag(tag
))) {
51 cgit_print_error(fmt("Bad tag object: %s", revname
));
54 html("<table class='commit-info'>\n");
55 htmlf("<tr><td>Tag name</td><td>%s (%s)</td></tr>\n",
56 revname
, sha1_to_hex(sha1
));
57 if (info
->tagger_date
> 0) {
58 html("<tr><td>Tag date</td><td>");
59 cgit_print_date(info
->tagger_date
, FMT_LONGDATE
);
63 html("<tr><td>Tagged by</td><td>");
64 html_txt(info
->tagger
);
67 html("<tr><td>Tagged object</td><td>");
68 cgit_object_link(tag
->tagged
);
71 print_tag_content(info
->msg
);