Skip to content

Commit a041d94

Browse files
author
Junio C Hamano
committed
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>
1 parent f085383 commit a041d94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

diff.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ static void copy_file(int prefix, const char *data, int size)
142142

143143
static void emit_rewrite_diff(const char *name_a,
144144
const char *name_b,
145-
struct diff_filespec *one,
145+
struct diff_filespec *one,
146146
struct diff_filespec *two)
147147
{
148-
/* Use temp[i].name as input, name_a and name_b as labels */
149148
int lc_a, lc_b;
149+
diff_populate_filespec(one, 0);
150+
diff_populate_filespec(two, 0);
150151
lc_a = count_lines(one->data, one->size);
151152
lc_b = count_lines(two->data, two->size);
152153
printf("--- %s\n+++ %s\n@@ -", name_a, name_b);

0 commit comments

Comments
 (0)