author | Lars Hjemli <hjemli@gmail.com> | 2009-01-31 09:40:40 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-01-31 09:40:40 (UTC) |
commit | c495cf02bac16e459f7c9e1740798646f12c00c5 (patch) (unidiff) | |
tree | a36ba3904edd96ffc79fdf420fb10d33117a469f /ui-log.c | |
parent | d6174b7aab476c2b6a86e59d98cf978d603045f4 (diff) | |
download | cgit-c495cf02bac16e459f7c9e1740798646f12c00c5.zip cgit-c495cf02bac16e459f7c9e1740798646f12c00c5.tar.gz cgit-c495cf02bac16e459f7c9e1740798646f12c00c5.tar.bz2 |
Handle binary files in diffs
This teaches all diff-related operations (i.e. ui-log, ui-diff and ui-patch)
how to handle binary files.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-log.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -25,11 +25,16 @@ void count_lines(char *line, int size) | |||
25 | } | 25 | } |
26 | 26 | ||
27 | void inspect_files(struct diff_filepair *pair) | 27 | void inspect_files(struct diff_filepair *pair) |
28 | { | 28 | { |
29 | unsigned long old_size = 0; | ||
30 | unsigned long new_size = 0; | ||
31 | int binary = 0; | ||
32 | |||
29 | files++; | 33 | files++; |
30 | if (ctx.repo->enable_log_linecount) | 34 | if (ctx.repo->enable_log_linecount) |
31 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); | 35 | cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, |
36 | &new_size, &binary, count_lines); | ||
32 | } | 37 | } |
33 | 38 | ||
34 | void show_commit_decorations(struct commit *commit) | 39 | void show_commit_decorations(struct commit *commit) |
35 | { | 40 | { |