diff options
Diffstat (limited to 'ui-diff.c')
-rw-r--r-- | ui-diff.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -16,7 +16,6 @@ unsigned char new_rev_sha1[20]; | |||
16 | static int files, slots; | 16 | static int files, slots; |
17 | static int total_adds, total_rems, max_changes; | 17 | static int total_adds, total_rems, max_changes; |
18 | static int lines_added, lines_removed; | 18 | static int lines_added, lines_removed; |
19 | static char *curr_rev; | ||
20 | 19 | ||
21 | static struct fileinfo { | 20 | static struct fileinfo { |
22 | char status; | 21 | char status; |
@@ -80,8 +79,8 @@ static void print_fileinfo(struct fileinfo *info) | |||
80 | html("]</span>"); | 79 | html("]</span>"); |
81 | } | 80 | } |
82 | htmlf("</td><td class='%s'>", class); | 81 | htmlf("</td><td class='%s'>", class); |
83 | cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, curr_rev, | 82 | cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
84 | NULL, info->new_path); | 83 | ctx.qry.sha2, info->new_path); |
85 | if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) | 84 | if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) |
86 | htmlf(" (%s from %s)", | 85 | htmlf(" (%s from %s)", |
87 | info->status == DIFF_STATUS_COPIED ? "copied" : "renamed", | 86 | info->status == DIFF_STATUS_COPIED ? "copied" : "renamed", |
@@ -145,7 +144,6 @@ void cgit_print_diffstat(const unsigned char *old_sha1, | |||
145 | html("<div class='diffstat-header'>Diffstat</div>"); | 144 | html("<div class='diffstat-header'>Diffstat</div>"); |
146 | html("<table summary='diffstat' class='diffstat'>"); | 145 | html("<table summary='diffstat' class='diffstat'>"); |
147 | max_changes = 0; | 146 | max_changes = 0; |
148 | curr_rev = xstrdup(sha1_to_hex(new_sha1)); | ||
149 | cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, NULL); | 147 | cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, NULL); |
150 | for(i = 0; i<files; i++) | 148 | for(i = 0; i<files; i++) |
151 | print_fileinfo(&items[i]); | 149 | print_fileinfo(&items[i]); |