summaryrefslogtreecommitdiffabout
path: root/ui-summary.c
Side-by-side diff
Diffstat (limited to 'ui-summary.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-summary.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ui-summary.c b/ui-summary.c
index b99ea98..e7158cc 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -35,3 +35,3 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
url = cgit_pageurl(cgit_query_repo, "commit",
- fmt("id=%s", sha1_to_hex(sha1)));
+ fmt("h=%s", sha1_to_hex(sha1)));
html_link_open(url, NULL, NULL);
@@ -54,13 +54,17 @@ static void cgit_print_object_ref(struct object *obj)
{
- char *page, *url;
+ char *page, *arg, *url;
- if (obj->type == OBJ_COMMIT)
+ if (obj->type == OBJ_COMMIT) {
page = "commit";
- else if (obj->type == OBJ_TREE)
+ arg = "h";
+ } else if (obj->type == OBJ_TREE) {
page = "tree";
- else
+ arg = "id";
+ } else {
page = "view";
+ arg = "id";
+ }
url = cgit_pageurl(cgit_query_repo, page,
- fmt("id=%s", sha1_to_hex(obj->sha1)));
+ fmt("%s=%s", arg, sha1_to_hex(obj->sha1)));
html_link_open(url, NULL, NULL);