summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-15 06:23:18 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-15 06:23:18 (GMT)
commitef58d9587ebad999b3decfcf369ba3b4ff72b121 (patch)
tree97ce21fa70768e86e47c267ff0fb176e877d47dd
parente267c2f6f0784e242883b7d3fe5f36ef63d6950d (diff)
downloadgit-ef58d9587ebad999b3decfcf369ba3b4ff72b121.zip
git-ef58d9587ebad999b3decfcf369ba3b4ff72b121.tar.gz
git-ef58d9587ebad999b3decfcf369ba3b4ff72b121.tar.bz2
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>
-rw-r--r--builtin-apply.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index aad5526..b80ad2c 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2116,7 +2116,11 @@ static void numstat_patch_list(struct patch *patch)
for ( ; patch; patch = patch->next) {
const char *name;
name = patch->new_name ? patch->new_name : patch->old_name;
- printf("%d\t%d\t", patch->lines_added, patch->lines_deleted);
+ if (patch->is_binary)
+ printf("-\t-\t");
+ else
+ printf("%d\t%d\t",
+ patch->lines_added, patch->lines_deleted);
if (line_termination && quote_c_style(name, NULL, NULL, 0))
quote_c_style(name, NULL, stdout, 0);
else