Skip to content

Commit

Permalink
diff --shortstat: do not count "unmerged" entries
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Nov 27, 2012
1 parent 82dfc2c commit 20c8cde
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20c8cde

Please sign in to comment.