summaryrefslogtreecommitdiff
path: root/src/diff_patch.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-10-05 23:37:22 +0200
committerEdward Thomson <ethomson@edwardthomson.com>2015-10-05 23:37:22 +0200
commitfe965028885fbd8c62dce08e3a86cd3cb3e3b320 (patch)
tree8eb2eb3e6851f119a2725c5ff6e16978ab1f3662 /src/diff_patch.c
parent2de198b4cec26c2b54c06da4baf88b3f57b9ca86 (diff)
parentbf70c359be6ec65f591fa677dbe11a26e5186607 (diff)
downloadlibgit2-0.23.3.tar.gz
Merge pull request #3452 from ethomson/0.23_xdiffv0.23.3
0.23 xdiff
Diffstat (limited to 'src/diff_patch.c')
-rw-r--r--src/diff_patch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/diff_patch.c b/src/diff_patch.c
index 0628da6f2..50faa3b3f 100644
--- a/src/diff_patch.c
+++ b/src/diff_patch.c
@@ -30,6 +30,10 @@ static void diff_patch_update_binary(git_patch *patch)
(patch->nfile.file->flags & GIT_DIFF_FLAG_BINARY) != 0)
patch->delta->flags |= GIT_DIFF_FLAG_BINARY;
+ else if (patch->ofile.file->size > GIT_XDIFF_MAX_SIZE ||
+ patch->nfile.file->size > GIT_XDIFF_MAX_SIZE)
+ patch->delta->flags |= GIT_DIFF_FLAG_BINARY;
+
else if ((patch->ofile.file->flags & DIFF_FLAGS_NOT_BINARY) != 0 &&
(patch->nfile.file->flags & DIFF_FLAGS_NOT_BINARY) != 0)
patch->delta->flags |= GIT_DIFF_FLAG_NOT_BINARY;