summaryrefslogtreecommitdiffabout
path: root/ui-diff.c
Side-by-side diff
Diffstat (limited to 'ui-diff.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-diff.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui-diff.c b/ui-diff.c
index 7ff7e46..a53425d 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -31,12 +31,23 @@ static struct fileinfo {
unsigned long old_size;
unsigned long new_size;
int binary:1;
} *items;
static int use_ssdiff = 0;
+static struct diff_filepair *current_filepair;
+
+struct diff_filespec *cgit_get_current_old_file(void)
+{
+ return current_filepair->one;
+}
+
+struct diff_filespec *cgit_get_current_new_file(void)
+{
+ return current_filepair->two;
+}
static void print_fileinfo(struct fileinfo *info)
{
char *class;
switch (info->status) {
@@ -281,12 +292,13 @@ 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;
+ current_filepair = pair;
if (use_ssdiff) {
cgit_ssdiff_header_begin();
print_line_fn = cgit_ssdiff_line_cb;
}
header(pair->one->sha1, pair->one->path, pair->one->mode,
pair->two->sha1, pair->two->path, pair->two->mode);