Commit 0e1ba46c by Edward Thomson

Remove the "merge none" flag

The "merge none" (don't automerge) flag was only to aide in
merge trivial tests.  We can easily determine whether merge
trivial resulted in a trivial merge or an automerge by examining
the REUC after automerge has completed.
parent 6891a862
......@@ -38,14 +38,11 @@ typedef enum {
/* Produce a conflict in a file when two similar regions are changed. */
GIT_MERGE_FILE_FAVOR_NORMAL = 0,
/* Do not attempt to produce an automerged file during tree merge. */
GIT_MERGE_FILE_FAVOR_NO_MERGE = 1,
/* Produce a file containing the "ours" side of conflicting regions. */
GIT_MERGE_FILE_FAVOR_OURS = 2,
GIT_MERGE_FILE_FAVOR_OURS = 1,
/* Produce a file containing the "theirs" side of conflicting regions. */
GIT_MERGE_FILE_FAVOR_THEIRS = 3,
GIT_MERGE_FILE_FAVOR_THEIRS = 2,
} git_merge_file_favor_t;
......
......@@ -527,9 +527,6 @@ static int merge_conflict_resolve_automerge(
*resolved = 0;
if (merge_file_favor == GIT_MERGE_FILE_FAVOR_NO_MERGE)
return 0;
merge_file_opts.favor = merge_file_favor;
/* Reject D/F conflicts */
......@@ -603,16 +600,14 @@ static int merge_conflict_resolve(
if ((error = merge_conflict_resolve_trivial(&resolved, diff_list, conflict)) < 0)
goto done;
if (merge_file_favor != GIT_MERGE_FILE_FAVOR_NO_MERGE) {
if (!resolved && (error = merge_conflict_resolve_one_removed(&resolved, diff_list, conflict)) < 0)
goto done;
if (!resolved && (error = merge_conflict_resolve_one_removed(&resolved, diff_list, conflict)) < 0)
goto done;
if (!resolved && (error = merge_conflict_resolve_one_renamed(&resolved, diff_list, conflict)) < 0)
goto done;
if (!resolved && (error = merge_conflict_resolve_one_renamed(&resolved, diff_list, conflict)) < 0)
goto done;
if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, merge_file_favor)) < 0)
goto done;
}
if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, merge_file_favor)) < 0)
goto done;
*out = resolved;
......
......@@ -25,7 +25,7 @@ void test_merge_trees_trivial__cleanup(void)
}
static int merge_trivial(git_index **index, const char *ours, const char *theirs, bool automerge)
static int merge_trivial(git_index **index, const char *ours, const char *theirs)
{
git_commit *our_commit, *their_commit, *ancestor_commit;
git_tree *our_tree, *their_tree, *ancestor_tree;
......@@ -33,8 +33,6 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
git_buf branch_buf = GIT_BUF_INIT;
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
opts.file_favor |= automerge ? 0 : GIT_MERGE_FILE_FAVOR_NO_MERGE;
git_buf_printf(&branch_buf, "%s%s", GIT_REFS_HEADS_DIR, ours);
cl_git_pass(git_reference_name_to_id(&our_oid, repo, branch_buf.ptr));
cl_git_pass(git_commit_lookup(&our_commit, repo, &our_oid));
......@@ -86,7 +84,7 @@ void test_merge_trees_trivial__2alt(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-2alt", "trivial-2alt-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-2alt", "trivial-2alt-branch"));
cl_assert(entry = git_index_get_bypath(result, "new-in-branch.txt", 0));
cl_assert(git_index_reuc_entrycount(result) == 0);
......@@ -101,7 +99,7 @@ void test_merge_trees_trivial__3alt(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-3alt", "trivial-3alt-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-3alt", "trivial-3alt-branch"));
cl_assert(entry = git_index_get_bypath(result, "new-in-3alt.txt", 0));
cl_assert(git_index_reuc_entrycount(result) == 0);
......@@ -116,7 +114,7 @@ void test_merge_trees_trivial__4(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-4", "trivial-4-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-4", "trivial-4-branch"));
cl_assert((entry = git_index_get_bypath(result, "new-and-different.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
......@@ -134,7 +132,7 @@ void test_merge_trees_trivial__5alt_1(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-5alt-1", "trivial-5alt-1-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-5alt-1", "trivial-5alt-1-branch"));
cl_assert(entry = git_index_get_bypath(result, "new-and-same.txt", 0));
cl_assert(git_index_reuc_entrycount(result) == 0);
......@@ -149,7 +147,7 @@ void test_merge_trees_trivial__5alt_2(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-5alt-2", "trivial-5alt-2-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-5alt-2", "trivial-5alt-2-branch"));
cl_assert(entry = git_index_get_bypath(result, "modified-to-same.txt", 0));
cl_assert(git_index_reuc_entrycount(result) == 0);
......@@ -163,26 +161,9 @@ void test_merge_trees_trivial__6(void)
{
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-6", "trivial-6-branch", 0));
cl_assert((entry = git_index_get_bypath(result, "removed-in-both.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
cl_assert(merge_trivial_conflict_entrycount(result) == 1);
cl_assert(entry = git_index_get_bypath(result, "removed-in-both.txt", 1));
git_index_free(result);
}
/* 6: ancest:ancest+, head:(empty), remote:(empty) = result:no merge */
void test_merge_trees_trivial__6_automerge(void)
{
git_index *result;
const git_index_entry *entry;
const git_index_reuc_entry *reuc;
cl_git_pass(merge_trivial(&result, "trivial-6", "trivial-6-branch", 1));
cl_git_pass(merge_trivial(&result, "trivial-6", "trivial-6-branch"));
cl_assert((entry = git_index_get_bypath(result, "removed-in-both.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 1);
......@@ -198,27 +179,9 @@ void test_merge_trees_trivial__8(void)
{
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-8", "trivial-8-branch", 0));
cl_assert((entry = git_index_get_bypath(result, "removed-in-8.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
cl_assert(merge_trivial_conflict_entrycount(result) == 2);
cl_assert(entry = git_index_get_bypath(result, "removed-in-8.txt", 1));
cl_assert(entry = git_index_get_bypath(result, "removed-in-8.txt", 3));
git_index_free(result);
}
/* 8: ancest:ancest^, head:(empty), remote:ancest = result:no merge */
void test_merge_trees_trivial__8_automerge(void)
{
git_index *result;
const git_index_entry *entry;
const git_index_reuc_entry *reuc;
cl_git_pass(merge_trivial(&result, "trivial-8", "trivial-8-branch", 1));
cl_git_pass(merge_trivial(&result, "trivial-8", "trivial-8-branch"));
cl_assert((entry = git_index_get_bypath(result, "removed-in-8.txt", 0)) == NULL);
......@@ -236,25 +199,7 @@ void test_merge_trees_trivial__7(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-7", "trivial-7-branch", 0));
cl_assert((entry = git_index_get_bypath(result, "removed-in-7.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
cl_assert(merge_trivial_conflict_entrycount(result) == 2);
cl_assert(entry = git_index_get_bypath(result, "removed-in-7.txt", 1));
cl_assert(entry = git_index_get_bypath(result, "removed-in-7.txt", 3));
git_index_free(result);
}
/* 7: ancest:ancest+, head:(empty), remote:remote = result:no merge */
void test_merge_trees_trivial__7_automerge(void)
{
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-7", "trivial-7-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-7", "trivial-7-branch"));
cl_assert((entry = git_index_get_bypath(result, "removed-in-7.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
......@@ -271,27 +216,9 @@ void test_merge_trees_trivial__10(void)
{
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-10", "trivial-10-branch", 0));
cl_assert((entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
cl_assert(merge_trivial_conflict_entrycount(result) == 2);
cl_assert(entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 1));
cl_assert(entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 2));
git_index_free(result);
}
/* 10: ancest:ancest^, head:ancest, remote:(empty) = result:no merge */
void test_merge_trees_trivial__10_automerge(void)
{
git_index *result;
const git_index_entry *entry;
const git_index_reuc_entry *reuc;
cl_git_pass(merge_trivial(&result, "trivial-10", "trivial-10-branch", 1));
cl_git_pass(merge_trivial(&result, "trivial-10", "trivial-10-branch"));
cl_assert((entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 0)) == NULL);
......@@ -309,25 +236,7 @@ void test_merge_trees_trivial__9(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-9", "trivial-9-branch", 0));
cl_assert((entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
cl_assert(merge_trivial_conflict_entrycount(result) == 2);
cl_assert(entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 1));
cl_assert(entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 2));
git_index_free(result);
}
/* 9: ancest:ancest+, head:head, remote:(empty) = result:no merge */
void test_merge_trees_trivial__9_automerge(void)
{
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-9", "trivial-9-branch", 1));
cl_git_pass(merge_trivial(&result, "trivial-9", "trivial-9-branch"));
cl_assert((entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
......@@ -346,7 +255,7 @@ void test_merge_trees_trivial__13(void)
const git_index_entry *entry;
git_oid expected_oid;
cl_git_pass(merge_trivial(&result, "trivial-13", "trivial-13-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-13", "trivial-13-branch"));
cl_assert(entry = git_index_get_bypath(result, "modified-in-13.txt", 0));
cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b"));
......@@ -365,7 +274,7 @@ void test_merge_trees_trivial__14(void)
const git_index_entry *entry;
git_oid expected_oid;
cl_git_pass(merge_trivial(&result, "trivial-14", "trivial-14-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-14", "trivial-14-branch"));
cl_assert(entry = git_index_get_bypath(result, "modified-in-14-branch.txt", 0));
cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9"));
......@@ -383,7 +292,7 @@ void test_merge_trees_trivial__11(void)
git_index *result;
const git_index_entry *entry;
cl_git_pass(merge_trivial(&result, "trivial-11", "trivial-11-branch", 0));
cl_git_pass(merge_trivial(&result, "trivial-11", "trivial-11-branch"));
cl_assert((entry = git_index_get_bypath(result, "modified-in-both.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(result) == 0);
......
......@@ -28,7 +28,7 @@ void test_merge_workdir_trivial__cleanup(void)
}
static int merge_trivial(const char *ours, const char *theirs, bool automerge)
static int merge_trivial(const char *ours, const char *theirs)
{
git_buf branch_buf = GIT_BUF_INIT;
git_checkout_opts checkout_opts = GIT_CHECKOUT_OPTS_INIT;
......@@ -39,8 +39,6 @@ static int merge_trivial(const char *ours, const char *theirs, bool automerge)
checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE;
opts.merge_tree_opts.file_favor |= automerge ? 0 : GIT_MERGE_FILE_FAVOR_NO_MERGE;
git_buf_printf(&branch_buf, "%s%s", GIT_REFS_HEADS_DIR, ours);
cl_git_pass(git_reference_symbolic_create(&our_ref, repo, "HEAD", branch_buf.ptr, 1, NULL, NULL));
......@@ -83,7 +81,7 @@ void test_merge_workdir_trivial__2alt(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-2alt", "trivial-2alt-branch", 0));
cl_git_pass(merge_trivial("trivial-2alt", "trivial-2alt-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "new-in-branch.txt", 0));
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......@@ -95,7 +93,7 @@ void test_merge_workdir_trivial__3alt(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-3alt", "trivial-3alt-branch", 0));
cl_git_pass(merge_trivial("trivial-3alt", "trivial-3alt-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "new-in-3alt.txt", 0));
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......@@ -107,7 +105,7 @@ void test_merge_workdir_trivial__4(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-4", "trivial-4-branch", 0));
cl_git_pass(merge_trivial("trivial-4", "trivial-4-branch"));
cl_assert((entry = git_index_get_bypath(repo_index, "new-and-different.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......@@ -122,7 +120,7 @@ void test_merge_workdir_trivial__5alt_1(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-5alt-1", "trivial-5alt-1-branch", 0));
cl_git_pass(merge_trivial("trivial-5alt-1", "trivial-5alt-1-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "new-and-same.txt", 0));
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......@@ -134,7 +132,7 @@ void test_merge_workdir_trivial__5alt_2(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-5alt-2", "trivial-5alt-2-branch", 0));
cl_git_pass(merge_trivial("trivial-5alt-2", "trivial-5alt-2-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "modified-to-same.txt", 0));
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......@@ -145,23 +143,9 @@ void test_merge_workdir_trivial__5alt_2(void)
void test_merge_workdir_trivial__6(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-6", "trivial-6-branch", 0));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-both.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
cl_assert(merge_trivial_conflict_entrycount() == 1);
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-both.txt", 1));
}
/* 6: ancest:ancest+, head:(empty), remote:(empty) = result:no merge */
void test_merge_workdir_trivial__6_automerge(void)
{
const git_index_entry *entry;
const git_index_reuc_entry *reuc;
cl_git_pass(merge_trivial("trivial-6", "trivial-6-branch", 1));
cl_git_pass(merge_trivial("trivial-6", "trivial-6-branch"));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-both.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 1);
......@@ -174,24 +158,9 @@ void test_merge_workdir_trivial__6_automerge(void)
void test_merge_workdir_trivial__8(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-8", "trivial-8-branch", 0));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
cl_assert(merge_trivial_conflict_entrycount() == 2);
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 1));
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 3));
}
/* 8: ancest:ancest^, head:(empty), remote:ancest = result:no merge */
void test_merge_workdir_trivial__8_automerge(void)
{
const git_index_entry *entry;
const git_index_reuc_entry *reuc;
cl_git_pass(merge_trivial("trivial-8", "trivial-8-branch", 1));
cl_git_pass(merge_trivial("trivial-8", "trivial-8-branch"));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 0)) == NULL);
......@@ -206,22 +175,7 @@ void test_merge_workdir_trivial__7(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-7", "trivial-7-branch", 0));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
cl_assert(merge_trivial_conflict_entrycount() == 2);
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 1));
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 3));
}
/* 7: ancest:ancest+, head:(empty), remote:remote = result:no merge */
void test_merge_workdir_trivial__7_automerge(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-7", "trivial-7-branch", 0));
cl_git_pass(merge_trivial("trivial-7", "trivial-7-branch"));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......@@ -235,24 +189,9 @@ void test_merge_workdir_trivial__7_automerge(void)
void test_merge_workdir_trivial__10(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-10", "trivial-10-branch", 0));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
cl_assert(merge_trivial_conflict_entrycount() == 2);
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 1));
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 2));
}
/* 10: ancest:ancest^, head:ancest, remote:(empty) = result:no merge */
void test_merge_workdir_trivial__10_automerge(void)
{
const git_index_entry *entry;
const git_index_reuc_entry *reuc;
cl_git_pass(merge_trivial("trivial-10", "trivial-10-branch", 1));
cl_git_pass(merge_trivial("trivial-10", "trivial-10-branch"));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 0)) == NULL);
......@@ -267,22 +206,7 @@ void test_merge_workdir_trivial__9(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-9", "trivial-9-branch", 0));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
cl_assert(merge_trivial_conflict_entrycount() == 2);
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 1));
cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 2));
}
/* 9: ancest:ancest+, head:head, remote:(empty) = result:no merge */
void test_merge_workdir_trivial__9_automerge(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-9", "trivial-9-branch", 1));
cl_git_pass(merge_trivial("trivial-9", "trivial-9-branch"));
cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......@@ -298,7 +222,7 @@ void test_merge_workdir_trivial__13(void)
const git_index_entry *entry;
git_oid expected_oid;
cl_git_pass(merge_trivial("trivial-13", "trivial-13-branch", 0));
cl_git_pass(merge_trivial("trivial-13", "trivial-13-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "modified-in-13.txt", 0));
cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b"));
......@@ -314,7 +238,7 @@ void test_merge_workdir_trivial__14(void)
const git_index_entry *entry;
git_oid expected_oid;
cl_git_pass(merge_trivial("trivial-14", "trivial-14-branch", 0));
cl_git_pass(merge_trivial("trivial-14", "trivial-14-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "modified-in-14-branch.txt", 0));
cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9"));
......@@ -329,7 +253,7 @@ void test_merge_workdir_trivial__11(void)
{
const git_index_entry *entry;
cl_git_pass(merge_trivial("trivial-11", "trivial-11-branch", 0));
cl_git_pass(merge_trivial("trivial-11", "trivial-11-branch"));
cl_assert((entry = git_index_get_bypath(repo_index, "modified-in-both.txt", 0)) == NULL);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
......
......@@ -343,22 +343,19 @@ void test_revert_workdir__conflict_use_ours(void)
git_revert_opts opts = GIT_REVERT_OPTS_INIT;
struct merge_index_entry merge_index_entries[] = {
{ 0100644, "3a3ef367eaf3fe79effbfb0a56b269c04c2b59fe", 1, "file1.txt" },
{ 0100644, "7731926a337c4eaba1e2187d90ebfa0a93659382", 2, "file1.txt" },
{ 0100644, "747726e021bc5f44b86de60e3032fd6f9f1b8383", 3, "file1.txt" },
{ 0100644, "caf99de3a49827117bb66721010eac461b06a80c", 0, "file1.txt" },
{ 0100644, "0ab09ea6d4c3634bdf6c221626d8b6f7dd890767", 0, "file2.txt" },
{ 0100644, "f4e107c230d08a60fb419d19869f1f282b272d9c", 0, "file3.txt" },
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
};
struct merge_index_entry merge_filesystem_entries[] = {
{ 0100644, "7731926a337c4eaba1e2187d90ebfa0a93659382", 0, "file1.txt" },
{ 0100644, "caf99de3a49827117bb66721010eac461b06a80c", 0, "file1.txt" },
{ 0100644, "0ab09ea6d4c3634bdf6c221626d8b6f7dd890767", 0, "file2.txt" },
{ 0100644, "f4e107c230d08a60fb419d19869f1f282b272d9c", 0, "file3.txt" },
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
};
opts.merge_tree_opts.file_favor = GIT_MERGE_FILE_FAVOR_NO_MERGE;
opts.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
......@@ -369,7 +366,7 @@ void test_revert_workdir__conflict_use_ours(void)
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, &opts));
cl_assert(merge_test_index(repo_index, merge_index_entries, 6));
cl_assert(merge_test_index(repo_index, merge_index_entries, 4));
cl_assert(merge_test_workdir(repo, merge_filesystem_entries, 4));
git_commit_free(commit);
......
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