summaryrefslogtreecommitdiff
path: root/tests/apply/both.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-11-05 15:49:11 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2018-11-05 16:13:37 +0000
commit4e746d80d229a77b08c5689a64d880bde5fd960f (patch)
tree06e90a656ded076db5baabf9218ae421ce674d9e /tests/apply/both.c
parentf8b9493b521494f0fd928bf4708abd7450fcea44 (diff)
downloadlibgit2-ethomson/apply.tar.gz
test: ensure applying a patch can't delete a file twiceethomson/apply
Diffstat (limited to 'tests/apply/both.c')
-rw-r--r--tests/apply/both.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/apply/both.c b/tests/apply/both.c
index cac5acba7..5091b8cfd 100644
--- a/tests/apply/both.c
+++ b/tests/apply/both.c
@@ -723,3 +723,14 @@ void test_apply_both__readd_deleted_file(void)
git_diff_free(diff);
}
+
+void test_apply_both__cant_remove_file_twice(void)
+{
+ git_diff *diff;
+
+ cl_git_pass(git_diff_from_buffer(&diff, DIFF_REMOVE_FILE_TWICE,
+ strlen(DIFF_REMOVE_FILE_TWICE)));
+ cl_git_fail(git_apply(repo, diff, GIT_APPLY_LOCATION_BOTH, NULL));
+
+ git_diff_free(diff);
+}