From: Junio C Hamano Date: Mon, 7 May 2012 20:29:08 +0000 (-0700) Subject: Merge branch 'zj/diff-empty-chmod' X-Git-Tag: v1.7.11-rc0~53 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fc1320bfe2419e5eb3f43761e27ffa4f42a81825;p=git.git Merge branch 'zj/diff-empty-chmod' "git diff --stat" used to fully count a binary file with modified execution bits whose contents is unmodified, which was not right. By Zbigniew Jędrzejewski-Szmek (4) and Johannes Sixt (1) * zj/diff-empty-chmod: t4006: Windows do not have /dev/zero diff --stat: do not run diff on indentical files diff --stat: report mode-only changes for binary files like text files tests: check --[short]stat output after chmod test: modernize style of t4006 Conflicts: diff.c --- fc1320bfe2419e5eb3f43761e27ffa4f42a81825 diff --cc diff.c index 02081d2af,8e61f4bf8..77edd5086 --- a/diff.c +++ b/diff.c @@@ -1614,8 -1583,12 +1614,12 @@@ static void show_stats(struct diffstat_ if (data->files[i]->is_binary) { fprintf(options->file, "%s", line_prefix); show_name(options->file, prefix, name, len); - fprintf(options->file, " %*s ", number_width, "Bin"); - fprintf(options->file, "%s%"PRIuMAX"%s", - fprintf(options->file, " Bin"); ++ fprintf(options->file, " %*s", number_width, "Bin"); + if (!added && !deleted) { + putc('\n', options->file); + continue; + } + fprintf(options->file, " %s%"PRIuMAX"%s", del_c, deleted, reset); fprintf(options->file, " -> "); fprintf(options->file, "%s%"PRIuMAX"%s",