summaryrefslogtreecommitdiff
path: root/tests/apply
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-07-10 09:09:27 -0500
committerEdward Thomson <ethomson@github.com>2016-05-26 13:01:04 -0500
commit8d2eef27ffae3fe9cfbaa0c0c16655598b5b1d6b (patch)
tree27e31dd8b32b8b1deecf4f74182f72ba8c7a1e59 /tests/apply
parent5d17d72621acad4aa216cf6a05c7f46b8206f284 (diff)
downloadlibgit2-8d2eef27ffae3fe9cfbaa0c0c16655598b5b1d6b.tar.gz
patch parsing: ensure empty patches are illegal
Diffstat (limited to 'tests/apply')
-rw-r--r--tests/apply/fromfile.c8
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));
+}