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>
maint
Junio C Hamano 2006-04-08 19:45:39 -07:00
parent f0853837d6
commit a041d94f29
1 changed files with 3 additions and 2 deletions

3
diff.c
View File

@ -145,8 +145,9 @@ static void emit_rewrite_diff(const char *name_a,
struct diff_filespec *one, struct diff_filespec *one,
struct diff_filespec *two) struct diff_filespec *two)
{ {
/* Use temp[i].name as input, name_a and name_b as labels */
int lc_a, lc_b; int lc_a, lc_b;
diff_populate_filespec(one, 0);
diff_populate_filespec(two, 0);
lc_a = count_lines(one->data, one->size); lc_a = count_lines(one->data, one->size);
lc_b = count_lines(two->data, two->size); lc_b = count_lines(two->data, two->size);
printf("--- %s\n+++ %s\n@@ -", name_a, name_b); printf("--- %s\n+++ %s\n@@ -", name_a, name_b);