X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/f2ced535e9f2c2ada7f184735a07a1190a9d810f..aa25ff3c8b548077f2793c1162f3610af03e63df:/ui-diff.c
diff --git a/ui-diff.c b/ui-diff.c
index f8782df..c6bad63 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -169,7 +169,7 @@ static void inspect_filepair(struct diff_filepair *pair)
void cgit_print_diffstat(const unsigned char *old_sha1,
const unsigned char *new_sha1, const char *prefix)
{
- int i, save_context = ctx.qry.context;
+ int i;
html("
");
html("");
max_changes = 0;
@@ -280,19 +267,6 @@ static void header(unsigned char *sha1, char *path1, int mode1,
html("");
}
-static void print_ssdiff_link()
-{
- if (!strcmp(ctx.qry.page, "diff")) {
- if (use_ssdiff)
- cgit_diff_link("Unidiff", NULL, NULL, ctx.qry.head,
- ctx.qry.sha1, ctx.qry.sha2, ctx.qry.path, 1);
- else
- cgit_diff_link("Side-by-side diff", NULL, NULL,
- ctx.qry.head, ctx.qry.sha1,
- ctx.qry.sha2, ctx.qry.path, 1);
- }
-}
-
static void filepair_cb(struct diff_filepair *pair)
{
unsigned long old_size = 0;
@@ -332,7 +306,54 @@ static void filepair_cb(struct diff_filepair *pair)
cgit_ssdiff_footer();
}
-void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefix)
+void cgit_print_diff_ctrls()
+{
+ int i, curr;
+
+ html("");
+ html("
diff options");
+ html("
");
+ html("
");
+}
+
+void cgit_print_diff(const char *new_rev, const char *old_rev,
+ const char *prefix, int show_ctrls)
{
enum object_type type;
unsigned long size;
@@ -374,7 +395,9 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi
use_ssdiff = ctx.qry.has_ssdiff ? ctx.qry.ssdiff : ctx.cfg.ssdiff;
- print_ssdiff_link();
+ if (show_ctrls)
+ cgit_print_diff_ctrls();
+
cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix);
if (use_ssdiff) {