summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--cgit.c1
-rw-r--r--cgit.h1
-rw-r--r--ui-diff.c3
3 files changed, 3 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 5259f56..435ce5a 100644
--- a/cgit.c
+++ b/cgit.c
@@ -281,6 +281,7 @@ static void querystring_cb(const char *name, const char *value)
 		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")) {
diff --git a/cgit.h b/cgit.h
index b5f00fc..63847ff 100644
--- a/cgit.h
+++ b/cgit.h
@@ -133,6 +133,7 @@ struct reflist {
 struct cgit_query {
 	int has_symref;
 	int has_sha1;
+	int has_ssdiff;
 	char *raw;
 	char *repo;
 	char *page;
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);