summaryrefslogtreecommitdiffabout
path: root/ui-diff.c
Unidiff
Diffstat (limited to 'ui-diff.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-diff.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/ui-diff.c b/ui-diff.c
index a92a768..e0a72f7 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -129,3 +129,3 @@ static void inspect_filepair(struct diff_filepair *pair)
129 cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size, 129 cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size,
130 &binary, count_diff_lines); 130 &binary, 0, count_diff_lines);
131 if (files >= slots) { 131 if (files >= slots) {
@@ -156,5 +156,5 @@ static void inspect_filepair(struct diff_filepair *pair)
156void cgit_print_diffstat(const unsigned char *old_sha1, 156void cgit_print_diffstat(const unsigned char *old_sha1,
157 const unsigned char *new_sha1) 157 const unsigned char *new_sha1, const char *prefix)
158{ 158{
159 int i; 159 int i, save_context = ctx.qry.context;
160 160
@@ -163,2 +163,12 @@ void cgit_print_diffstat(const unsigned char *old_sha1,
163 ctx.qry.sha2, NULL, 0); 163 ctx.qry.sha2, NULL, 0);
164 if (prefix)
165 htmlf(" (limited to '%s')", prefix);
166 html(" (");
167 ctx.qry.context = (save_context > 0 ? save_context : 3) << 1;
168 cgit_self_link("more", NULL, NULL, &ctx);
169 html("/");
170 ctx.qry.context = (save_context > 3 ? save_context : 3) >> 1;
171 cgit_self_link("less", NULL, NULL, &ctx);
172 ctx.qry.context = save_context;
173 html(" context)");
164 html("</div>"); 174 html("</div>");
@@ -166,3 +176,3 @@ void cgit_print_diffstat(const unsigned char *old_sha1,
166 max_changes = 0; 176 max_changes = 0;
167 cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, NULL); 177 cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, prefix);
168 for(i = 0; i<files; i++) 178 for(i = 0; i<files; i++)
@@ -288,3 +298,3 @@ static void filepair_cb(struct diff_filepair *pair)
288 if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, 298 if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size,
289 &new_size, &binary, print_line_fn)) 299 &new_size, &binary, ctx.qry.context, print_line_fn))
290 cgit_print_error("Error running diff"); 300 cgit_print_error("Error running diff");
@@ -340,3 +350,3 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi
340 print_ssdiff_link(); 350 print_ssdiff_link();
341 cgit_print_diffstat(old_rev_sha1, new_rev_sha1); 351 cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix);
342 352