Showing the changes to ui-commit.c (1 of 17 files). Show all
Unified · Split
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | #include "ui-diff.h" |
| 13 | 13 | #include "ui-log.h" |
| 14 | 14 | |
| 15 | −void cgit_print_commit(char *hex) | |
| 15 | +void cgit_print_commit(char *hex, const char *prefix) | |
| 16 | 16 | { |
| 17 | 17 | struct commit *commit, *parent; |
| 18 | 18 | struct commitinfo *info, *parent_info; |
| @@ -58,19 +58,23 @@ void cgit_print_commit(char *hex) · 39 unmodified lines | ||
| 58 | 58 | html("</td></tr>\n"); |
| 59 | 59 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); |
| 60 | 60 | tmp = sha1_to_hex(commit->object.sha1); |
| 61 | − cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, 0); | |
| 61 | + cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0); | |
| 62 | 62 | html(" ("); |
| 63 | − cgit_patch_link("patch", NULL, NULL, NULL, tmp); | |
| 63 | + cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); | |
| 64 | 64 | html(") ("); |
| 65 | 65 | if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) |
| 66 | − cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, 1); | |
| 66 | + cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); | |
| 67 | 67 | else |
| 68 | − cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, 1); | |
| 68 | + cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); | |
| 69 | 69 | html(")</td></tr>\n"); |
| 70 | 70 | html("<tr><th>tree</th><td colspan='2' class='sha1'>"); |
| 71 | 71 | tmp = xstrdup(hex); |
| 72 | 72 | cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, |
| 73 | 73 | ctx.qry.head, tmp, NULL); |
| 74 | + if (prefix) { | |
| 75 | + html(" /"); | |
| 76 | + cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tmp, prefix); | |
| 77 | + } | |
| 74 | 78 | html("</td></tr>\n"); |
| 75 | 79 | for (p = commit->parents; p ; p = p->next) { |
| 76 | 80 | parent = lookup_commit_reference(p->item->object.sha1); |
| @@ -87,10 +91,10 @@ void cgit_print_commit(char *hex) · 10 unmodified lines | ||
| 87 | 91 | parent_info = cgit_parse_commit(parent); |
| 88 | 92 | tmp2 = parent_info->subject; |
| 89 | 93 | } |
| 90 | − cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, 0); | |
| 94 | + cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix, 0); | |
| 91 | 95 | html(" ("); |
| 92 | 96 | cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, |
| 93 | − sha1_to_hex(p->item->object.sha1), NULL, 0); | |
| 97 | + sha1_to_hex(p->item->object.sha1), prefix, 0); | |
| 94 | 98 | html(")</td></tr>"); |
| 95 | 99 | parents++; |
| 96 | 100 | } |
| @@ -121,7 +125,7 @@ void cgit_print_commit(char *hex) · 24 unmodified lines | ||
| 121 | 125 | tmp = sha1_to_hex(commit->parents->item->object.sha1); |
| 122 | 126 | else |
| 123 | 127 | tmp = NULL; |
| 124 | − cgit_print_diff(ctx.qry.sha1, tmp, NULL); | |
| 128 | + cgit_print_diff(ctx.qry.sha1, tmp, prefix); | |
| 125 | 129 | } |
| 126 | 130 | cgit_free_commitinfo(info); |
| 127 | 131 | } |