diff options
Diffstat (limited to 'ui-diff.c')
-rw-r--r-- | ui-diff.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -34,6 +34,17 @@ static struct fileinfo { | |||
34 | } *items; | 34 | } *items; |
35 | 35 | ||
36 | static int use_ssdiff = 0; | 36 | static int use_ssdiff = 0; |
37 | static struct diff_filepair *current_filepair; | ||
38 | |||
39 | struct diff_filespec *cgit_get_current_old_file(void) | ||
40 | { | ||
41 | return current_filepair->one; | ||
42 | } | ||
43 | |||
44 | struct diff_filespec *cgit_get_current_new_file(void) | ||
45 | { | ||
46 | return current_filepair->two; | ||
47 | } | ||
37 | 48 | ||
38 | static void print_fileinfo(struct fileinfo *info) | 49 | static void print_fileinfo(struct fileinfo *info) |
39 | { | 50 | { |
@@ -161,8 +172,11 @@ void cgit_print_diffstat(const unsigned char *old_sha1, | |||
161 | html("<div class='diffstat-header'>"); | 172 | html("<div class='diffstat-header'>"); |
162 | cgit_diff_link("Diffstat", NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 173 | cgit_diff_link("Diffstat", NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
163 | ctx.qry.sha2, NULL, 0); | 174 | ctx.qry.sha2, NULL, 0); |
164 | if (prefix) | 175 | if (prefix) { |
165 | htmlf(" (limited to '%s')", prefix); | 176 | html(" (limited to '"); |
177 | html_txt(prefix); | ||
178 | html("')"); | ||
179 | } | ||
166 | html(" ("); | 180 | html(" ("); |
167 | ctx.qry.context = (save_context > 0 ? save_context : 3) << 1; | 181 | ctx.qry.context = (save_context > 0 ? save_context : 3) << 1; |
168 | cgit_self_link("more", NULL, NULL, &ctx); | 182 | cgit_self_link("more", NULL, NULL, &ctx); |
@@ -284,6 +298,7 @@ static void filepair_cb(struct diff_filepair *pair) | |||
284 | int binary = 0; | 298 | int binary = 0; |
285 | linediff_fn print_line_fn = print_line; | 299 | linediff_fn print_line_fn = print_line; |
286 | 300 | ||
301 | current_filepair = pair; | ||
287 | if (use_ssdiff) { | 302 | if (use_ssdiff) { |
288 | cgit_ssdiff_header_begin(); | 303 | cgit_ssdiff_header_begin(); |
289 | print_line_fn = cgit_ssdiff_line_cb; | 304 | print_line_fn = cgit_ssdiff_line_cb; |