merge: default checkout strategy for should be SAFE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/src/merge.c b/src/merge.c
index 2e40b6d..0b73d2b 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -2186,7 +2186,7 @@ static int merge_normalize_checkout_opts(
const git_merge_head **their_heads)
{
int error = 0;
- unsigned int default_checkout_strategy = GIT_CHECKOUT_SAFE_CREATE |
+ unsigned int default_checkout_strategy = GIT_CHECKOUT_SAFE |
GIT_CHECKOUT_ALLOW_CONFLICTS;
GIT_UNUSED(repo);
diff --git a/tests/merge/workdir/dirty.c b/tests/merge/workdir/dirty.c
index 1d596c5..6c21c2a 100644
--- a/tests/merge/workdir/dirty.c
+++ b/tests/merge/workdir/dirty.c
@@ -260,6 +260,23 @@ void test_merge_workdir_dirty__unaffected_dirty_files_allowed(void)
cl_git_pass(merge_dirty_files(files));
}
+void test_merge_workdir_dirty__unstaged_deletes_maintained(void)
+{
+ git_reference *head;
+ git_object *head_object;
+
+ cl_git_pass(git_repository_head(&head, repo));
+ cl_git_pass(git_reference_peel(&head_object, head, GIT_OBJ_COMMIT));
+ cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL, NULL));
+
+ cl_git_pass(p_unlink("merge-resolve/unchanged.txt"));
+
+ cl_git_pass(merge_branch(0, 0));
+
+ git_object_free(head_object);
+ git_reference_free(head);
+}
+
void test_merge_workdir_dirty__affected_dirty_files_disallowed(void)
{
char **files;