-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | ui-commit.c | 2 | ||||
-rw-r--r-- | ui-log.c | 3 | ||||
-rw-r--r-- | ui-summary.c | 16 |
4 files changed, 13 insertions, 10 deletions
@@ -117,5 +117,5 @@ static void cgit_print_repo_page(struct cacheitem *item) | |||
117 | cgit_print_tree(cgit_query_head, cgit_query_sha1, cgit_query_path); | 117 | cgit_print_tree(cgit_query_head, cgit_query_sha1, cgit_query_path); |
118 | } else if (!strcmp(cgit_query_page, "commit")) { | 118 | } else if (!strcmp(cgit_query_page, "commit")) { |
119 | cgit_print_commit(cgit_query_sha1); | 119 | cgit_print_commit(cgit_query_head); |
120 | } else if (!strcmp(cgit_query_page, "view")) { | 120 | } else if (!strcmp(cgit_query_page, "view")) { |
121 | cgit_print_view(cgit_query_sha1, cgit_query_path); | 121 | cgit_print_view(cgit_query_sha1, cgit_query_path); |
diff --git a/ui-commit.c b/ui-commit.c index 8011dfc..93eb8fd 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -198,5 +198,5 @@ void cgit_print_commit(const char *hex) | |||
198 | "<td colspan='2' class='sha1'>" | 198 | "<td colspan='2' class='sha1'>" |
199 | "<a href='"); | 199 | "<a href='"); |
200 | query = fmt("id=%s", sha1_to_hex(p->item->object.sha1)); | 200 | query = fmt("h=%s", sha1_to_hex(p->item->object.sha1)); |
201 | html_attr(cgit_pageurl(cgit_query_repo, "commit", query)); | 201 | html_attr(cgit_pageurl(cgit_query_repo, "commit", query)); |
202 | htmlf("'>%s</a> (<a href='", | 202 | htmlf("'>%s</a> (<a href='", |
@@ -35,5 +35,5 @@ void print_commit(struct commit *commit) | |||
35 | html_txt(buf); | 35 | html_txt(buf); |
36 | html("</td><td>"); | 36 | html("</td><td>"); |
37 | char *qry = fmt("id=%s", sha1_to_hex(commit->object.sha1)); | 37 | char *qry = fmt("h=%s", sha1_to_hex(commit->object.sha1)); |
38 | char *url = cgit_pageurl(cgit_query_repo, "commit", qry); | 38 | char *url = cgit_pageurl(cgit_query_repo, "commit", qry); |
39 | html_link_open(url, NULL, NULL); | 39 | html_link_open(url, NULL, NULL); |
@@ -122,3 +122,2 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path) | |||
122 | html("</div>"); | 122 | html("</div>"); |
123 | } | 123 | } |
124 | |||
diff --git a/ui-summary.c b/ui-summary.c index b99ea98..e7158cc 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -34,5 +34,5 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1, | |||
34 | html("</td><td>"); | 34 | html("</td><td>"); |
35 | url = cgit_pageurl(cgit_query_repo, "commit", | 35 | url = cgit_pageurl(cgit_query_repo, "commit", |
36 | fmt("id=%s", sha1_to_hex(sha1))); | 36 | fmt("h=%s", sha1_to_hex(sha1))); |
37 | html_link_open(url, NULL, NULL); | 37 | html_link_open(url, NULL, NULL); |
38 | html_ntxt(cgit_max_msg_len, info->subject); | 38 | html_ntxt(cgit_max_msg_len, info->subject); |
@@ -53,15 +53,19 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1, | |||
53 | static void cgit_print_object_ref(struct object *obj) | 53 | static void cgit_print_object_ref(struct object *obj) |
54 | { | 54 | { |
55 | char *page, *url; | 55 | char *page, *arg, *url; |
56 | 56 | ||
57 | if (obj->type == OBJ_COMMIT) | 57 | if (obj->type == OBJ_COMMIT) { |
58 | page = "commit"; | 58 | page = "commit"; |
59 | else if (obj->type == OBJ_TREE) | 59 | arg = "h"; |
60 | } else if (obj->type == OBJ_TREE) { | ||
60 | page = "tree"; | 61 | page = "tree"; |
61 | else | 62 | arg = "id"; |
63 | } else { | ||
62 | page = "view"; | 64 | page = "view"; |
65 | arg = "id"; | ||
66 | } | ||
63 | 67 | ||
64 | url = cgit_pageurl(cgit_query_repo, page, | 68 | url = cgit_pageurl(cgit_query_repo, page, |
65 | fmt("id=%s", sha1_to_hex(obj->sha1))); | 69 | fmt("%s=%s", arg, sha1_to_hex(obj->sha1))); |
66 | html_link_open(url, NULL, NULL); | 70 | html_link_open(url, NULL, NULL); |
67 | htmlf("%s %s", typename(obj->type), | 71 | htmlf("%s %s", typename(obj->type), |