diff options
author | Gregory Herrero <gregory.herrero@oracle.com> | 2019-11-07 14:13:14 +0100 |
---|---|---|
committer | Gregory Herrero <gregory.herrero@oracle.com> | 2019-11-19 09:33:12 +0100 |
commit | 048e94adbba3c21b9ad739640cce11a8b387df48 (patch) | |
tree | 73c8ff28cb3dd6640cebf3acbda6956ceabd6ca1 /tests/patch/patch_common.h | |
parent | b921964b25c14c8dfeb26d1a5efedb28ee9e7284 (diff) | |
download | libgit2-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/patch_common.h')
-rw-r--r-- | tests/patch/patch_common.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/patch/patch_common.h b/tests/patch/patch_common.h index 92ab7692e..1c6ad7ea8 100644 --- a/tests/patch/patch_common.h +++ b/tests/patch/patch_common.h @@ -878,6 +878,12 @@ "index 27184d9..7c94f9e 100644\n" \ "Binary files a/binary.bin and b/binary.bin differ\n" +#define PATCH_ADD_BINARY_NOT_PRINTED \ + "diff --git a/test.bin b/test.bin\n" \ + "new file mode 100644\n" \ + "index 0000000..9e0f96a\n" \ + "Binary files /dev/null and b/test.bin differ\n" + #define PATCH_ORIGINAL_NEW_FILE_WITH_SPACE \ "diff --git a/sp ace.txt b/sp ace.txt\n" \ "new file mode 100644\n" \ |