diff options
Diffstat (limited to 'ui-diff.c')
-rw-r--r-- | ui-diff.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ui-diff.c b/ui-diff.c index 868ceec..c6bad63 100644 --- a/ui-diff.c +++ b/ui-diff.c | |||
@@ -97,10 +97,12 @@ static void print_fileinfo(struct fileinfo *info) | |||
97 | htmlf("</td><td class='%s'>", class); | 97 | htmlf("</td><td class='%s'>", class); |
98 | cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 98 | cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
99 | ctx.qry.sha2, info->new_path, 0); | 99 | ctx.qry.sha2, info->new_path, 0); |
100 | if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) | 100 | if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) { |
101 | htmlf(" (%s from %s)", | 101 | htmlf(" (%s from ", |
102 | info->status == DIFF_STATUS_COPIED ? "copied" : "renamed", | 102 | info->status == DIFF_STATUS_COPIED ? "copied" : "renamed"); |
103 | info->old_path); | 103 | html_txt(info->old_path); |
104 | html(")"); | ||
105 | } | ||
104 | html("</td><td class='right'>"); | 106 | html("</td><td class='right'>"); |
105 | if (info->binary) { | 107 | if (info->binary) { |
106 | htmlf("bin</td><td class='graph'>%ld -> %ld bytes", | 108 | htmlf("bin</td><td class='graph'>%ld -> %ld bytes", |
@@ -339,9 +341,7 @@ void cgit_print_diff_ctrls() | |||
339 | html("<td class='label'>mode:</td>"); | 341 | html("<td class='label'>mode:</td>"); |
340 | html("<td class='ctrl'>"); | 342 | html("<td class='ctrl'>"); |
341 | html("<select name='ss' onchange='this.form.submit();'>"); | 343 | html("<select name='ss' onchange='this.form.submit();'>"); |
342 | curr = ctx.qry.ssdiff; | 344 | curr = ctx.qry.has_ssdiff ? ctx.qry.ssdiff : ctx.cfg.ssdiff; |
343 | if (!curr && ctx.cfg.ssdiff) | ||
344 | curr = 1; | ||
345 | html_intoption(0, "unified", curr); | 345 | html_intoption(0, "unified", curr); |
346 | html_intoption(1, "ssdiff", curr); | 346 | html_intoption(1, "ssdiff", curr); |
347 | html("</select></td></tr>"); | 347 | html("</select></td></tr>"); |
@@ -393,8 +393,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, | |||
393 | } | 393 | } |
394 | } | 394 | } |
395 | 395 | ||
396 | if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) | 396 | use_ssdiff = ctx.qry.has_ssdiff ? ctx.qry.ssdiff : ctx.cfg.ssdiff; |
397 | use_ssdiff = 1; | ||
398 | 397 | ||
399 | if (show_ctrls) | 398 | if (show_ctrls) |
400 | cgit_print_diff_ctrls(); | 399 | cgit_print_diff_ctrls(); |