summaryrefslogtreecommitdiff
path: root/ui-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-diff.c')
-rw-r--r--ui-diff.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/ui-diff.c b/ui-diff.c
index 2196745..0c6f8d7 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -9,6 +9,7 @@
#include "cgit.h"
#include "html.h"
#include "ui-shared.h"
+#include "ui-ssdiff.h"
unsigned char old_rev_sha1[20];
unsigned char new_rev_sha1[20];
@@ -32,6 +33,7 @@ static struct fileinfo {
int binary:1;
} *items;
+static int use_ssdiff = 0;
static void print_fileinfo(struct fileinfo *info)
{
@@ -244,6 +246,8 @@ static void header(unsigned char *sha1, char *path1, int mode1,
html_txt(path2);
}
html("</div>");
+ if (use_ssdiff)
+ cgit_ssdiff_header();
}
static void filepair_cb(struct diff_filepair *pair)
@@ -251,9 +255,14 @@ static void filepair_cb(struct diff_filepair *pair)
unsigned long old_size = 0;
unsigned long new_size = 0;
int binary = 0;
+ linediff_fn print_line_fn = print_line;
header(pair->one->sha1, pair->one->path, pair->one->mode,
pair->two->sha1, pair->two->path, pair->two->mode);
+ if (use_ssdiff) {
+ cgit_ssdiff_header();
+ print_line_fn = cgit_ssdiff_line_cb;
+ }
if (S_ISGITLINK(pair->one->mode) || S_ISGITLINK(pair->two->mode)) {
if (S_ISGITLINK(pair->one->mode))
print_line(fmt("-Subproject %s", sha1_to_hex(pair->one->sha1)), 52);
@@ -261,11 +270,13 @@ static void filepair_cb(struct diff_filepair *pair)
print_line(fmt("+Subproject %s", sha1_to_hex(pair->two->sha1)), 52);
return;
}
- if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size,
- &new_size, &binary, print_line))
+ if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size,
+ &new_size, &binary, print_line_fn))
cgit_print_error("Error running diff");
if (binary)
html("Binary files differ");
+ if (use_ssdiff)
+ cgit_ssdiff_footer();
}
void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefix)
oro3-7/+33 2007-08-12added listener/notifynecoro1-1/+1 2007-08-12added listener/notifynecoro2-2/+1 2007-08-12added listener/notifynecoro22-531/+704 2007-08-10add splash screennecoro12-158/+355 2007-08-07new threading model in gui_helpernecoro9-159/+237 2007-08-06small fixesnecoro3-4/+6 2007-08-05some translation fixes :)necoro2-0/+3 2007-08-05some translation fixes :)necoro1-1/+1 2007-08-05some translation fixes :)necoro7-358/+357 2007-08-05pocompile testnecoro1-2/+2 2007-08-05pocompile testnecoro1-2/+3 2007-08-05pocompile testnecoro1-1/+6 2007-08-05i18n support and german translationsnecoro3-3/+11 2007-08-05i18n support and german translationsnecoro19-87/+1391 2007-08-04added an uncaught exception dialognecoro2-2/+1 2007-08-04added an uncaught exception dialognecoro4-3/+93 2007-08-04bugfixesnecoro3-5/+20 2007-08-01Removed "(GTK)" from desktop filenecoro1-1/+1 2007-07-30updatesnecoro1-1/+1 2007-07-30updatesnecoro2-21/+64 2007-07-28some more pause emerge itemsnecoro5-276/+423 2007-07-27changed design / added linknecoro3-66/+154 2007-07-26changed design / added linknecoro2-34/+27 2007-07-25changed design / added linknecoro5-86/+188 2007-07-24made the resume_loop-plugin change titles toonecoro5-7/+22 2007-07-21added logviewersnecoro7-215/+429 2007-07-21updated howtonecoro1-14/+24 2007-07-20new Plugin Schemenecoro1-5/+4 2007-07-20new Plugin Schemenecoro1-1/+1 2007-07-20new Plugin Schemenecoro9-162/+214 2007-07-13fixesnecoro4-27/+37 2007-07-13new fancier log outputnecoro14-127/+116 2007-07-11added SIGSTOP/SIGCONT support; SIGTERM now works ;)necoro8-208/+275 2007-07-09bug in shutdown pluginnecoro2-5/+12 2007-07-09added resume_loop pluginnecoro1-1/+1 2007-07-09added resume_loop pluginnecoro10-22/+162 2007-07-07some more documentationnecoro6-4/+108 2007-07-07Some documentation worknecoro7-18/+129