Skip to content

Commit ef58d95

Browse files
author
Junio C Hamano
committed
apply --numstat: mark binary diffstat with - -, not 0 0
We do not even know number of lines so showing it as 0 0 is lying. This would also help Porcelains like cvsexportcommit. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent e267c2f commit ef58d95

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

builtin-apply.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,11 @@ static void numstat_patch_list(struct patch *patch)
21162116
for ( ; patch; patch = patch->next) {
21172117
const char *name;
21182118
name = patch->new_name ? patch->new_name : patch->old_name;
2119-
printf("%d\t%d\t", patch->lines_added, patch->lines_deleted);
2119+
if (patch->is_binary)
2120+
printf("-\t-\t");
2121+
else
2122+
printf("%d\t%d\t",
2123+
patch->lines_added, patch->lines_deleted);
21202124
if (line_termination && quote_c_style(name, NULL, NULL, 0))
21212125
quote_c_style(name, NULL, stdout, 0);
21222126
else

0 commit comments

Comments
 (0)