Commit 26564d80 by Edward Thomson

merge: default checkout strategy for should be SAFE

parent 212b6205
...@@ -2186,7 +2186,7 @@ static int merge_normalize_checkout_opts( ...@@ -2186,7 +2186,7 @@ static int merge_normalize_checkout_opts(
const git_merge_head **their_heads) const git_merge_head **their_heads)
{ {
int error = 0; 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_CHECKOUT_ALLOW_CONFLICTS;
GIT_UNUSED(repo); GIT_UNUSED(repo);
......
...@@ -260,6 +260,23 @@ void test_merge_workdir_dirty__unaffected_dirty_files_allowed(void) ...@@ -260,6 +260,23 @@ void test_merge_workdir_dirty__unaffected_dirty_files_allowed(void)
cl_git_pass(merge_dirty_files(files)); 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) void test_merge_workdir_dirty__affected_dirty_files_disallowed(void)
{ {
char **files; char **files;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment