-rw-r--r-- | ui-shared.c | 3 |
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 | |||
@@ -259,32 +259,35 @@ void cgit_diff_link(char *name, char *title, char *class, char *head, | |||
259 | html("'>"); | 259 | html("'>"); |
260 | html_txt(name); | 260 | html_txt(name); |
261 | html("</a>"); | 261 | html("</a>"); |
262 | } | 262 | } |
263 | 263 | ||
264 | void cgit_object_link(struct object *obj) | 264 | void cgit_object_link(struct object *obj) |
265 | { | 265 | { |
266 | char *page, *arg, *url; | 266 | char *page, *arg, *url; |
267 | 267 | ||
268 | if (obj->type == OBJ_COMMIT) { | 268 | if (obj->type == OBJ_COMMIT) { |
269 | cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL, | 269 | cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL, |
270 | cgit_query_head, sha1_to_hex(obj->sha1)); | 270 | cgit_query_head, sha1_to_hex(obj->sha1)); |
271 | return; | 271 | return; |
272 | } else if (obj->type == OBJ_TREE) { | 272 | } else if (obj->type == OBJ_TREE) { |
273 | page = "tree"; | 273 | page = "tree"; |
274 | arg = "id"; | 274 | arg = "id"; |
275 | } else if (obj->type == OBJ_TAG) { | ||
276 | page = "tag"; | ||
277 | arg = "id"; | ||
275 | } else { | 278 | } else { |
276 | page = "blob"; | 279 | page = "blob"; |
277 | arg = "id"; | 280 | arg = "id"; |
278 | } | 281 | } |
279 | 282 | ||
280 | url = cgit_pageurl(cgit_query_repo, page, | 283 | url = cgit_pageurl(cgit_query_repo, page, |
281 | fmt("%s=%s", arg, sha1_to_hex(obj->sha1))); | 284 | fmt("%s=%s", arg, sha1_to_hex(obj->sha1))); |
282 | html_link_open(url, NULL, NULL); | 285 | html_link_open(url, NULL, NULL); |
283 | htmlf("%s %s", typename(obj->type), | 286 | htmlf("%s %s", typename(obj->type), |
284 | sha1_to_hex(obj->sha1)); | 287 | sha1_to_hex(obj->sha1)); |
285 | html_link_close(); | 288 | html_link_close(); |
286 | } | 289 | } |
287 | 290 | ||
288 | void cgit_print_date(time_t secs, char *format) | 291 | void cgit_print_date(time_t secs, char *format) |
289 | { | 292 | { |
290 | char buf[64]; | 293 | char buf[64]; |