aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-11-27 14:19:36 -0800
committerJunio C Hamano <gitster@pobox.com>2012-11-27 14:19:36 -0800
commit20c8cde45656fc187e06088ef5baf0bbdfdf70bd (patch)
treea9cb9f370e9b7bcecc124fa73c8a1b7d30c25c8e /diff.c
parent82dfc2c44ecda8a7afe417086c704b141a11cd58 (diff)
downloadgit-20c8cde45656fc187e06088ef5baf0bbdfdf70bd.tar.gz
git-20c8cde45656fc187e06088ef5baf0bbdfdf70bd.tar.xz
diff --shortstat: do not count "unmerged" entries
Fix the same issue as the previous one for "git diff --stat"; unmerged entries was doubly-counted. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/diff.c b/diff.c
index 26ede82a7..374b2354f 100644
--- a/diff.c
+++ b/diff.c
@@ -1701,9 +1701,8 @@ static void show_shortstats(struct diffstat_t *data, struct diff_options *option
int added = data->files[i]->added;
int deleted= data->files[i]->deleted;
- if (data->files[i]->is_unmerged)
- continue;
- if (!data->files[i]->is_interesting && (added + deleted == 0)) {
+ if (data->files[i]->is_unmerged ||
+ (!data->files[i]->is_interesting && (added + deleted == 0))) {
total_files--;
} else if (!data->files[i]->is_binary) { /* don't count bytes */
adds += added;