|
diff --git a/ui-diff.c b/ui-diff.c index 7ab1e49..878496d 100644 --- a/ ui-diff.c+++ b/ ui-diff.c |
|
@@ -132,25 +132,28 @@ static void inspect_filepair(struct diff_filepair *pair) |
132 | items[files-1].removed = lines_removed; |
132 | items[files-1].removed = lines_removed; |
133 | if (lines_added + lines_removed > max_changes) |
133 | if (lines_added + lines_removed > max_changes) |
134 | max_changes = lines_added + lines_removed; |
134 | max_changes = lines_added + lines_removed; |
135 | total_adds += lines_added; |
135 | total_adds += lines_added; |
136 | total_rems += lines_removed; |
136 | total_rems += lines_removed; |
137 | } |
137 | } |
138 | |
138 | |
139 | void cgit_print_diffstat(const unsigned char *old_sha1, |
139 | void cgit_print_diffstat(const unsigned char *old_sha1, |
140 | const unsigned char *new_sha1) |
140 | const unsigned char *new_sha1) |
141 | { |
141 | { |
142 | int i; |
142 | int i; |
143 | |
143 | |
144 | html("<div class='diffstat-header'>Diffstat</div>"); |
144 | html("<div class='diffstat-header'>"); |
| |
145 | cgit_diff_link("Diffstat", NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
| |
146 | ctx.qry.sha2, NULL); |
| |
147 | html("</div>"); |
145 | html("<table summary='diffstat' class='diffstat'>"); |
148 | html("<table summary='diffstat' class='diffstat'>"); |
146 | max_changes = 0; |
149 | max_changes = 0; |
147 | cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, NULL); |
150 | cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, NULL); |
148 | for(i = 0; i<files; i++) |
151 | for(i = 0; i<files; i++) |
149 | print_fileinfo(&items[i]); |
152 | print_fileinfo(&items[i]); |
150 | html("</table>"); |
153 | html("</table>"); |
151 | html("<div class='diffstat-summary'>"); |
154 | html("<div class='diffstat-summary'>"); |
152 | htmlf("%d files changed, %d insertions, %d deletions", |
155 | htmlf("%d files changed, %d insertions, %d deletions", |
153 | files, total_adds, total_rems); |
156 | files, total_adds, total_rems); |
154 | html("</div>"); |
157 | html("</div>"); |
155 | } |
158 | } |
156 | |
159 | |
|