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>
Junio C Hamano committed
Apr 8, 2006 at 19:45 UTC
a041d94f29d76d53ff3cc4169b99c6eefea8639d
1 file changed
+3
-2
diff.c
+3
-2
@@ -142,11 +142,12 @@ static void copy_file(int prefix, const char *data, int size)
142
143
static void emit_rewrite_diff(const char *name_a,
144
const char *name_b,
145
- struct diff_filespec *one,
145
+ struct diff_filespec *one,
146
struct diff_filespec *two)
147
{
148
- /* Use temp[i].name as input, name_a and name_b as labels */
148
int lc_a, lc_b;
149
+ diff_populate_filespec(one, 0);
150
+ diff_populate_filespec(two, 0);
151
lc_a = count_lines(one->data, one->size);
152
lc_b = count_lines(two->data, two->size);
153
printf("--- %s\n+++ %s\n@@ -", name_a, name_b);