Skip to content

Commit

Permalink
diff: fix output of total-rewrite diff.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Apr 9, 2006
1 parent f085383 commit a041d94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a041d94

Please sign in to comment.