mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 14:39:10 +00:00
merge test: test an actual failure, not conflict
Correct the merge failed cleanup test. Merge data should not be cleaned up on conflicts, only on actual failure. And ORIG_HEAD should not be removed at all.
This commit is contained in:
parent
57f45e7f4d
commit
42f98a26a5
@ -1018,6 +1018,7 @@ void test_merge_workdir_setup__retained_after_success(void)
|
||||
git_annotated_commit_free(their_heads[0]);
|
||||
}
|
||||
|
||||
|
||||
void test_merge_workdir_setup__removed_after_failure(void)
|
||||
{
|
||||
git_oid our_oid;
|
||||
@ -1030,16 +1031,14 @@ void test_merge_workdir_setup__removed_after_failure(void)
|
||||
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
|
||||
cl_git_pass(git_annotated_commit_from_ref(&their_heads[0], repo, octo1_ref));
|
||||
|
||||
cl_git_rewritefile("merge-resolve/new-in-octo1.txt",
|
||||
"Conflicting file!\n\nMerge will fail!\n");
|
||||
cl_git_write2file("merge-resolve/.git/index.lock", "foo\n", 4, O_RDWR|O_CREAT, 0666);
|
||||
|
||||
cl_git_fail(git_merge(
|
||||
repo, (const git_annotated_commit **)&their_heads[0], 1, NULL, NULL));
|
||||
|
||||
cl_assert(!git_path_exists("merge-resolve/" GIT_MERGE_HEAD_FILE));
|
||||
cl_assert(!git_path_exists("merge-resolve/" GIT_ORIG_HEAD_FILE));
|
||||
cl_assert(!git_path_exists("merge-resolve/" GIT_MERGE_MODE_FILE));
|
||||
cl_assert(!git_path_exists("merge-resolve/" GIT_MERGE_MSG_FILE));
|
||||
cl_assert(!git_path_exists("merge-resolve/.git/" GIT_MERGE_HEAD_FILE));
|
||||
cl_assert(!git_path_exists("merge-resolve/.git/" GIT_MERGE_MODE_FILE));
|
||||
cl_assert(!git_path_exists("merge-resolve/.git/" GIT_MERGE_MSG_FILE));
|
||||
|
||||
git_reference_free(octo1_ref);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user