merge: default checkout strategy for should be SAFE

This commit is contained in:
Edward Thomson 2014-04-23 19:26:58 -04:00
parent 212b6205d7
commit 26564d80aa
2 changed files with 18 additions and 1 deletions

View File

@ -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);

View File

@ -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;