author | Lars Hjemli <hjemli@gmail.com> | 2007-10-28 14:40:47 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-10-28 14:41:58 (UTC) |
commit | fc5880fab8b9afc589aaadd1299c34a6ef2a3c2d (patch) (unidiff) | |
tree | a429f34b01fc1ce9a90d46b81915db5fa124f83b | |
parent | cbcdbcf2bff23113fe81df8f11fe7843b8ed637e (diff) | |
download | cgit-fc5880fab8b9afc589aaadd1299c34a6ef2a3c2d.zip cgit-fc5880fab8b9afc589aaadd1299c34a6ef2a3c2d.tar.gz cgit-fc5880fab8b9afc589aaadd1299c34a6ef2a3c2d.tar.bz2 |
Teach cgit_object_link() about tag objects
This makes random tag links more helpfull, e.g. when a branch head references
a tag object, link to the tag page.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-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 | |||
@@ -269,12 +269,15 @@ void cgit_object_link(struct object *obj) | |||
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, |