summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/diff_output.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/diff_output.c b/src/diff_output.c
index e8dd5b317..d462142f9 100644
--- a/src/diff_output.c
+++ b/src/diff_output.c
@@ -678,7 +678,8 @@ cleanup:
if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0 &&
delta->status != GIT_DELTA_UNMODIFIED &&
(patch->old_data.len || patch->new_data.len) &&
- !git_oid_equal(&delta->old_file.oid, &delta->new_file.oid))
+ ((patch->old_data.len != patch->new_data.len) ||
+ !git_oid_equal(&delta->old_file.oid, &delta->new_file.oid)))
patch->flags |= GIT_DIFF_PATCH_DIFFABLE;
}