aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorGravatar Lars Hjemli <hjemli@gmail.com>2008-12-06 19:34:48 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2008-12-06 19:34:48 (JST)
commite550440233875b298f8574e9273457516791010f (patch)
tree37464c686f1f2d8c5ba513c7dca5daa886dc81a6 /ui-shared.c
parent3157ea3b7e5204dba2892ffb54d641746c4c7ca4 (diff)
parentc57aceb1d2f1a7d9fd3218fc8c6e9ea01b2952d2 (diff)
downloadcgit-e550440233875b298f8574e9273457516791010f.zip
cgit-e550440233875b298f8574e9273457516791010f.tar.gz
Merge branch 'snapshot-fixes'
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 224e5f3..9319881 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -365,11 +365,14 @@ void cgit_patch_link(char *name, char *title, char *class, char *head,
365 365
366void cgit_object_link(struct object *obj) 366void cgit_object_link(struct object *obj)
367{ 367{
368 char *page, *rev, *name; 368 char *page, *shortrev, *fullrev, *name;
369 369
370 fullrev = sha1_to_hex(obj->sha1);
371 shortrev = xstrdup(fullrev);
372 shortrev[10] = '\0';
370 if (obj->type == OBJ_COMMIT) { 373 if (obj->type == OBJ_COMMIT) {
371 cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL, 374 cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
372 ctx.qry.head, sha1_to_hex(obj->sha1)); 375 ctx.qry.head, fullrev);
373 return; 376 return;
374 } else if (obj->type == OBJ_TREE) 377 } else if (obj->type == OBJ_TREE)
375 page = "tree"; 378 page = "tree";
@@ -377,9 +380,8 @@ void cgit_object_link(struct object *obj)
377 page = "tag"; 380 page = "tag";
378 else 381 else
379 page = "blob"; 382 page = "blob";
380 rev = sha1_to_hex(obj->sha1); 383 name = fmt("%s %s...", typename(obj->type), shortrev);
381 name = fmt("%s %s", typename(obj->type), rev); 384 reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL);
382 reporevlink(page, name, NULL, NULL, ctx.qry.head, rev, NULL);
383} 385}
384 386
385void cgit_print_date(time_t secs, char *format, int local_time) 387void cgit_print_date(time_t secs, char *format, int local_time)
@@ -707,8 +709,7 @@ void cgit_print_snapshot_links(const char *repo, const char *head,
707 continue; 709 continue;
708 filename = fmt("%s-%s%s", cgit_repobasename(repo), hex, 710 filename = fmt("%s-%s%s", cgit_repobasename(repo), hex,
709 f->suffix); 711 f->suffix);
710 cgit_snapshot_link(filename, NULL, NULL, (char *)head, 712 cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename);
711 (char *)hex, filename);
712 html("<br/>"); 713 html("<br/>");
713 } 714 }
714} 715}