summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index e21af3b7ee..50277b82b2 100644
--- a/diff.c
+++ b/diff.c
@@ -1376,7 +1376,9 @@ static void builtin_diff(const char *name_a,
*/
if ((one->mode ^ two->mode) & S_IFMT)
goto free_ab_and_return;
- if (complete_rewrite) {
+ if (complete_rewrite &&
+ !diff_filespec_is_binary(one) &&
+ !diff_filespec_is_binary(two)) {
emit_rewrite_diff(name_a, name_b, one, two, o);
o->found_changes = 1;
goto free_ab_and_return;