summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 1e12529..a959224 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -361,3 +361,3 @@ void cgit_object_link(struct object *obj)
361{ 361{
362 char *page, *arg, *url; 362 char *page, *rev, *name;
363 363
@@ -367,19 +367,11 @@ void cgit_object_link(struct object *obj)
367 return; 367 return;
368 } else if (obj->type == OBJ_TREE) { 368 } else if (obj->type == OBJ_TREE)
369 page = "tree"; 369 page = "tree";
370 arg = "id"; 370 else if (obj->type == OBJ_TAG)
371 } else if (obj->type == OBJ_TAG) {
372 page = "tag"; 371 page = "tag";
373 arg = "id"; 372 else
374 } else {
375 page = "blob"; 373 page = "blob";
376 arg = "id"; 374 rev = sha1_to_hex(obj->sha1);
377 } 375 name = fmt("%s %s", typename(obj->type), rev);
378 376 reporevlink(page, name, NULL, NULL, ctx.qry.head, rev, NULL);
379 url = cgit_pageurl(ctx.qry.repo, page,
380 fmt("%s=%s", arg, sha1_to_hex(obj->sha1)));
381 html_link_open(url, NULL, NULL);
382 htmlf("%s %s", typename(obj->type),
383 sha1_to_hex(obj->sha1));
384 html_link_close();
385} 377}