summaryrefslogtreecommitdiff
path: root/tests-clar/diff/diff_helpers.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-09-11 12:03:33 -0700
committerRussell Belfer <rb@github.com>2012-09-11 12:03:33 -0700
commit1f35e89dbf6e0be8952cc4324a45fd600be5ca05 (patch)
tree0489cf363f6bb7484c5de0f998b1acf3f831881b /tests-clar/diff/diff_helpers.c
parentc6ac28fdc57d04a9a5eba129cfd267c7adde43b3 (diff)
downloadlibgit2-1f35e89dbf6e0be8952cc4324a45fd600be5ca05.tar.gz
Fix diff binary file detection
In the process of adding tests for the max file size threshold (which treats files over a certain size as binary) there seem to be a number of problems in the new code with detecting binaries. This should fix those up, as well as add a test for the file size threshold stuff. Also, this un-deprecates `GIT_DIFF_LINE_ADD_EOFNL`, since I finally found a legitimate situation where it would be returned.
Diffstat (limited to 'tests-clar/diff/diff_helpers.c')
-rw-r--r--tests-clar/diff/diff_helpers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c
index ef59b686f..767b34392 100644
--- a/tests-clar/diff/diff_helpers.c
+++ b/tests-clar/diff/diff_helpers.c
@@ -89,7 +89,8 @@ int diff_line_fn(
e->line_adds++;
break;
case GIT_DIFF_LINE_ADD_EOFNL:
- assert(0);
+ /* technically not a line add, but we'll count it as such */
+ e->line_adds++;
break;
case GIT_DIFF_LINE_DELETION:
e->line_dels++;