Fix diff mode switching when side-by-side-diffs=1 When side-by-side-diffs=1 was set in cgitrc, specyfing 'ss=0' in the query- string would not switch to unified diffs. This patch fixes the issue by introducing a separate variable to track the occurrence of "ss" in the querystring.
Tim Chen timchen1@gmail.com
Tue, 03 Jan 2012 16:02:14 +0000
M
cgit.c
→
cgit.c
@@ -281,6 +281,7 @@ } else if (!strcmp(name, "period")) {
ctx.qry.period = xstrdup(value); } else if (!strcmp(name, "ss")) { ctx.qry.ssdiff = atoi(value); + ctx.qry.has_ssdiff = 1; } else if (!strcmp(name, "all")) { ctx.qry.show_all = atoi(value); } else if (!strcmp(name, "context")) {
M
ui-diff.c
→
ui-diff.c
@@ -372,8 +372,7 @@ return;
} } - if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) - use_ssdiff = 1; + use_ssdiff = ctx.qry.has_ssdiff ? ctx.qry.ssdiff : ctx.cfg.ssdiff; print_ssdiff_link(); cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix);