aboutsummaryrefslogtreecommitdiffstats
path: root/ui-diff.c
diff options
context:
space:
mode:
authorTim Chen <timchen1@gmail.com>2012-01-03 17:02:14 +0100
committerLars Hjemli <hjemli@gmail.com>2012-01-03 17:02:14 +0100
commitf2ced535e9f2c2ada7f184735a07a1190a9d810f (patch)
tree0272646e2e0124737d637c0d5e7a858b4ba8f003 /ui-diff.c
parent0b6a716d1b9f18e8cc00940a7962e542b9358238 (diff)
downloadcgit-f2ced535e9f2c2ada7f184735a07a1190a9d810f.tar.gz
cgit-f2ced535e9f2c2ada7f184735a07a1190a9d810f.tar.xz
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.
Diffstat (limited to 'ui-diff.c')
-rw-r--r--ui-diff.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui-diff.c b/ui-diff.c
index 383a534..f8782df 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -372,8 +372,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi
}
}
- 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);