summaryrefslogtreecommitdiff
path: root/tests/patch/print.c
diff options
context:
space:
mode:
authorGregory Herrero <gregory.herrero@oracle.com>2019-11-07 14:13:14 +0100
committerGregory Herrero <gregory.herrero@oracle.com>2019-11-19 09:33:12 +0100
commit048e94adbba3c21b9ad739640cce11a8b387df48 (patch)
tree73c8ff28cb3dd6640cebf3acbda6956ceabd6ca1 /tests/patch/print.c
parentb921964b25c14c8dfeb26d1a5efedb28ee9e7284 (diff)
downloadlibgit2-048e94adbba3c21b9ad739640cce11a8b387df48.tar.gz
patch_parse: correct parsing of patch containing not shown binary data.
When not shown binary data is added or removed in a patch, patch parser is currently returning 'error -1 - corrupt git binary header at line 4'. Fix it by correctly handling case where binary data is added/removed. Signed-off-by: Gregory Herrero <gregory.herrero@oracle.com>
Diffstat (limited to 'tests/patch/print.c')
-rw-r--r--tests/patch/print.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/patch/print.c b/tests/patch/print.c
index 4703c1d51..c4ff479e9 100644
--- a/tests/patch/print.c
+++ b/tests/patch/print.c
@@ -172,3 +172,9 @@ void test_patch_print__binary_not_shown(void)
patch_print_from_patchfile(PATCH_BINARY_NOT_PRINTED,
strlen(PATCH_BINARY_NOT_PRINTED));
}
+
+void test_patch_print__binary_add_not_shown(void)
+{
+ patch_print_from_patchfile(PATCH_ADD_BINARY_NOT_PRINTED,
+ strlen(PATCH_ADD_BINARY_NOT_PRINTED));
+}