aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/ui-shared.c b/ui-shared.c
index dc39e64..95dfeb4 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -371,11 +371,14 @@ void cgit_patch_link(char *name, char *title, char *class, char *head,
371 371
372void cgit_object_link(struct object *obj) 372void cgit_object_link(struct object *obj)
373{ 373{
374 char *page, *rev, *name; 374 char *page, *shortrev, *fullrev, *name;
375 375
376 fullrev = sha1_to_hex(obj->sha1);
377 shortrev = xstrdup(fullrev);
378 shortrev[10] = '\0';
376 if (obj->type == OBJ_COMMIT) { 379 if (obj->type == OBJ_COMMIT) {
377 cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL, 380 cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
378 ctx.qry.head, sha1_to_hex(obj->sha1)); 381 ctx.qry.head, fullrev);
379 return; 382 return;
380 } else if (obj->type == OBJ_TREE) 383 } else if (obj->type == OBJ_TREE)
381 page = "tree"; 384 page = "tree";
@@ -383,9 +386,8 @@ void cgit_object_link(struct object *obj)
383 page = "tag"; 386 page = "tag";
384 else 387 else
385 page = "blob"; 388 page = "blob";
386 rev = sha1_to_hex(obj->sha1); 389 name = fmt("%s %s...", typename(obj->type), shortrev);
387 name = fmt("%s %s", typename(obj->type), rev); 390 reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL);
388 reporevlink(page, name, NULL, NULL, ctx.qry.head, rev, NULL);
389} 391}
390 392
391void cgit_print_date(time_t secs, char *format, int local_time) 393void cgit_print_date(time_t secs, char *format, int local_time)
@@ -715,8 +717,7 @@ void cgit_print_snapshot_links(const char *repo, const char *head,
715 continue; 717 continue;
716 filename = fmt("%s-%s%s", cgit_repobasename(repo), hex, 718 filename = fmt("%s-%s%s", cgit_repobasename(repo), hex,
717 f->suffix); 719 f->suffix);
718 cgit_snapshot_link(filename, NULL, NULL, (char *)head, 720 cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename);
719 (char *)hex, filename);
720 html("<br/>"); 721 html("<br/>");
721 } 722 }
722} 723}