aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-08 19:45:39 -0700
committerJunio C Hamano <junkio@cox.net>2006-04-08 20:32:40 -0700
commita041d94f29d76d53ff3cc4169b99c6eefea8639d (patch)
treef2709900eb8bc5bc20eac470513084647b2a19f0 /diff.c
parentf0853837d6ee69dccfa59222a0e869de94bdddc6 (diff)
downloadgit-a041d94f29d76d53ff3cc4169b99c6eefea8639d.tar.gz
git-a041d94f29d76d53ff3cc4169b99c6eefea8639d.tar.xz
diff: fix output of total-rewrite diff.
We did not read in the file data before emitting the total-rewrite diff. Noticed by Pasky. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index ce98a9080..30e4d50b9 100644
--- a/diff.c
+++ b/diff.c
@@ -142,11 +142,12 @@ static void copy_file(int prefix, const char *data, int size)
static void emit_rewrite_diff(const char *name_a,
const char *name_b,
- struct diff_filespec *one,
+ struct diff_filespec *one,
struct diff_filespec *two)
{
- /* Use temp[i].name as input, name_a and name_b as labels */
int lc_a, lc_b;
+ diff_populate_filespec(one, 0);
+ diff_populate_filespec(two, 0);
lc_a = count_lines(one->data, one->size);
lc_b = count_lines(two->data, two->size);
printf("--- %s\n+++ %s\n@@ -", name_a, name_b);