Skip to content

Commit

Permalink
diff --numstat: show binary with '-' to match "apply --numstat"
Browse files Browse the repository at this point in the history
This changes the --numstat output for binary files from "0 0" to
"- -" to match what "apply --numstat" does.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Dec 11, 2006
1 parent 6f98725 commit bfddbc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,10 @@ static void show_numstat(struct diffstat_t* data, struct diff_options *options)
for (i = 0; i < data->nr; i++) {
struct diffstat_file *file = data->files[i];

printf("%d\t%d\t", file->added, file->deleted);
if (file->is_binary)
printf("-\t-\t");
else
printf("%d\t%d\t", file->added, file->deleted);
if (options->line_termination &&
quote_c_style(file->name, NULL, NULL, 0))
quote_c_style(file->name, NULL, stdout, 0);
Expand Down

0 comments on commit bfddbc5

Please sign in to comment.