Diff options
Diffstat (limited to '')
| -rw-r--r-- | source/ui-shared.c | 11 |
1 file changed, 4 insertions, 7 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c index 9ad398f..2760f64 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1076,16 +1076,13 @@ void cgit_stats_link(const char *name, const char *title, const char *class, void cgit_object_link(struct object *obj, int full) { const char *page; - char *shortrev, *fullrev, *name; + char *fullrev, *name; fullrev = oid_to_hex(&obj->oid); - if (full) { + if (full) name = cgit_fmt("%s %s", type_name(obj->type), fullrev); - } else { - shortrev = xstrdup(fullrev); - shortrev[SHORT_HASH_LEN] = '\0'; - name = cgit_fmt("%s %s...", type_name(obj->type), shortrev); - } + else + name = cgit_fmt("%s %.*s...", type_name(obj->type), SHORT_HASH_LEN, fullrev); if (obj->type == OBJ_COMMIT) { cgit_commit_link(name, NULL, NULL, ctx.qry.head, fullrev, NULL); return; |
