author | Lars Hjemli <hjemli@gmail.com> | 2009-08-16 17:52:27 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-08-16 18:53:20 (UTC) |
commit | 0730ee6ea4af45e29e7c74d4a32bde9d2d6c8104 (patch) (side-by-side diff) | |
tree | 539784d3a0a8c836f8c59a71fd1c9463116a09d2 | |
parent | 1bbe04c2c09d5dfbb2c66c4f8f490008b6e5fb25 (diff) | |
download | cgit-0730ee6ea4af45e29e7c74d4a32bde9d2d6c8104.zip cgit-0730ee6ea4af45e29e7c74d4a32bde9d2d6c8104.tar.gz cgit-0730ee6ea4af45e29e7c74d4a32bde9d2d6c8104.tar.bz2 |
ui-log.c: handle lightweight tags when printing commit decorations
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-log.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -32,48 +32,52 @@ void inspect_files(struct diff_filepair *pair) files++; if (ctx.repo->enable_log_linecount) cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size, &binary, count_lines); } void show_commit_decorations(struct commit *commit) { struct name_decoration *deco; static char buf[1024]; buf[sizeof(buf) - 1] = 0; deco = lookup_decoration(&name_decoration, &commit->object); while (deco) { if (!prefixcmp(deco->name, "refs/heads/")) { strncpy(buf, deco->name + 11, sizeof(buf) - 1); cgit_log_link(buf, NULL, "branch-deco", buf, NULL, NULL, 0, NULL, NULL, ctx.qry.showmsg); } else if (!prefixcmp(deco->name, "tag: refs/tags/")) { strncpy(buf, deco->name + 15, sizeof(buf) - 1); cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf); } + else if (!prefixcmp(deco->name, "refs/tags/")) { + strncpy(buf, deco->name + 10, sizeof(buf) - 1); + cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf); + } else if (!prefixcmp(deco->name, "refs/remotes/")) { strncpy(buf, deco->name + 13, sizeof(buf) - 1); cgit_log_link(buf, NULL, "remote-deco", NULL, sha1_to_hex(commit->object.sha1), NULL, 0, NULL, NULL, ctx.qry.showmsg); } else { strncpy(buf, deco->name, sizeof(buf) - 1); cgit_commit_link(buf, NULL, "deco", ctx.qry.head, sha1_to_hex(commit->object.sha1)); } deco = deco->next; } } void print_commit(struct commit *commit) { struct commitinfo *info; char *tmp; int cols = 2; info = cgit_parse_commit(commit); htmlf("<tr%s><td>", ctx.qry.showmsg ? " class='logheader'" : ""); |