summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/diff_print.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/diff_print.c b/src/diff_print.c
index f72ca8935..264bd19e9 100644
--- a/src/diff_print.c
+++ b/src/diff_print.c
@@ -521,13 +521,13 @@ static int diff_print_patch_file_binary(
size_t pre_binary_size;
int error;
+ if (delta->status == GIT_DELTA_UNMODIFIED)
+ return 0;
+
if ((pi->flags & GIT_DIFF_SHOW_BINARY) == 0)
return diff_print_patch_file_binary_noshow(
pi, delta, old_pfx, new_pfx);
- if (binary->new_file.datalen == 0 && binary->old_file.datalen == 0)
- return 0;
-
pre_binary_size = pi->buf->size;
git_buf_printf(pi->buf, "GIT binary patch\n");
pi->line.num_lines++;