author | Lars Hjemli <hjemli@gmail.com> | 2008-09-23 15:47:26 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-09-23 15:47:26 (UTC) |
commit | 04619c9b8512921a87187b9adf8573e2bdacd0a6 (patch) (unidiff) | |
tree | b25bd09ef7d09504dac0a09810598c4d183c53b3 | |
parent | 06e14dc61cf36c146f04de91497d2fe866c46f5e (diff) | |
download | cgit-04619c9b8512921a87187b9adf8573e2bdacd0a6.zip cgit-04619c9b8512921a87187b9adf8573e2bdacd0a6.tar.gz cgit-04619c9b8512921a87187b9adf8573e2bdacd0a6.tar.bz2 |
ui-diff: fix links from diffstat
The links in the diffstat is supposed to work as a filter for the diff,
but this only worked when a single rev was supplied, i.e. the filtered
diff was always against the parent of the specified rev.
With this patch it is now possible to use the diffstat as a 'filter menu'
for urls like http://hjemli.net/git/cgit/diff/?id=v0.7.2&id2=v0.7.1
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-diff.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -18,3 +18,2 @@ 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 | ||
@@ -82,4 +81,4 @@ static void print_fileinfo(struct fileinfo *info) | |||
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) |
@@ -147,3 +146,2 @@ void cgit_print_diffstat(const unsigned char *old_sha1, | |||
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); |