diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2015-07-10 09:09:27 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@github.com> | 2016-05-26 13:01:04 -0500 |
| commit | 8d2eef27ffae3fe9cfbaa0c0c16655598b5b1d6b (patch) | |
| tree | 27e31dd8b32b8b1deecf4f74182f72ba8c7a1e59 /tests/apply | |
| parent | 5d17d72621acad4aa216cf6a05c7f46b8206f284 (diff) | |
| download | libgit2-8d2eef27ffae3fe9cfbaa0c0c16655598b5b1d6b.tar.gz | |
patch parsing: ensure empty patches are illegal
Diffstat (limited to 'tests/apply')
| -rw-r--r-- | tests/apply/fromfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/apply/fromfile.c b/tests/apply/fromfile.c index 4b1bacddb..1e2165919 100644 --- a/tests/apply/fromfile.c +++ b/tests/apply/fromfile.c @@ -394,3 +394,11 @@ void test_apply_fromfile__binary_change_must_be_reversible(void) NULL, 0, PATCH_BINARY_NOT_REVERSIBLE, NULL, 0)); } + +void test_apply_fromfile__empty_file_not_allowed(void) +{ + git_patch *patch; + + cl_git_fail(git_patch_from_patchfile(&patch, "", 0)); + cl_git_fail(git_patch_from_patchfile(&patch, NULL, 0)); +} |
