diff --numstat: show binary with '-' to match "apply --numstat"
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>
Junio C Hamano committed
Dec 10, 2006 at 13:50 UTC
bfddbc5e1e68373ba96441ca228236667912265c
1 file changed
+4
-1
diff.c
+4
-1
@@ -802,7 +802,10 @@ static void show_numstat(struct diffstat_t* data, struct diff_options *options)
802
for (i = 0; i < data->nr; i++) {
803
struct diffstat_file *file = data->files[i];
804
805
- printf("%d\t%d\t", file->added, file->deleted);
805
+ if (file->is_binary)
806
+ printf("-\t-\t");
807
+ else
808
+ printf("%d\t%d\t", file->added, file->deleted);
809
if (options->line_termination &&
810
quote_c_style(file->name, NULL, NULL, 0))
811
quote_c_style(file->name, NULL, stdout, 0);