-rw-r--r-- | ui-summary.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/ui-summary.c b/ui-summary.c index b4bc6d8..de8a180 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -49,27 +49,2 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1, | |||
49 | 49 | ||
50 | |||
51 | static void cgit_print_object_ref(struct object *obj) | ||
52 | { | ||
53 | char *page, *arg, *url; | ||
54 | |||
55 | if (obj->type == OBJ_COMMIT) { | ||
56 | cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL, | ||
57 | cgit_query_head, sha1_to_hex(obj->sha1)); | ||
58 | return; | ||
59 | } else if (obj->type == OBJ_TREE) { | ||
60 | page = "tree"; | ||
61 | arg = "id"; | ||
62 | } else { | ||
63 | page = "view"; | ||
64 | arg = "id"; | ||
65 | } | ||
66 | |||
67 | url = cgit_pageurl(cgit_query_repo, page, | ||
68 | fmt("%s=%s", arg, sha1_to_hex(obj->sha1))); | ||
69 | html_link_open(url, NULL, NULL); | ||
70 | htmlf("%s %s", typename(obj->type), | ||
71 | sha1_to_hex(obj->sha1)); | ||
72 | html_link_close(); | ||
73 | } | ||
74 | |||
75 | static void print_tag_header() | 50 | static void print_tag_header() |
@@ -102,4 +77,4 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1, | |||
102 | html("<tr><td>"); | 77 | html("<tr><td>"); |
103 | url = cgit_pageurl(cgit_query_repo, "view", | 78 | url = cgit_pageurl(cgit_query_repo, "tag", |
104 | fmt("id=%s", sha1_to_hex(sha1))); | 79 | fmt("id=%s", refname)); |
105 | html_link_open(url, NULL, NULL); | 80 | html_link_open(url, NULL, NULL); |
@@ -114,3 +89,3 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1, | |||
114 | html("</td><td>"); | 89 | html("</td><td>"); |
115 | cgit_print_object_ref(tag->tagged); | 90 | cgit_object_link(tag->tagged); |
116 | html("</td></tr>\n"); | 91 | html("</td></tr>\n"); |
@@ -122,3 +97,3 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1, | |||
122 | html("</td><td colspan='2'/><td>"); | 97 | html("</td><td colspan='2'/><td>"); |
123 | cgit_print_object_ref(obj); | 98 | cgit_object_link(obj); |
124 | html("</td></tr>\n"); | 99 | html("</td></tr>\n"); |