diff options
Diffstat (limited to 'tests/merge/trees/automerge.c')
-rw-r--r-- | tests/merge/trees/automerge.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/tests/merge/trees/automerge.c b/tests/merge/trees/automerge.c index 746ce5068..c18881d7c 100644 --- a/tests/merge/trees/automerge.c +++ b/tests/merge/trees/automerge.c @@ -54,28 +54,6 @@ static git_repository *repo; "", \ "5c3b68a71fc4fa5d362fd3875e53137c6a5ab7a5" } -#define AUTOMERGEABLE_MERGED_FILE \ - "this file is changed in master\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is changed in branch\n" - -#define AUTOMERGEABLE_MERGED_FILE_CRLF \ - "this file is changed in master\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is changed in branch\r\n" - // Fixture setup and teardown void test_merge_trees_automerge__initialize(void) { @@ -91,7 +69,7 @@ void test_merge_trees_automerge__automerge(void) { git_index *index; const git_index_entry *entry; - git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; git_blob *blob; struct merge_index_entry merge_index_entries[] = { @@ -121,7 +99,7 @@ void test_merge_trees_automerge__automerge(void) cl_assert((entry = git_index_get_bypath(index, "automergeable.txt", 0)) != NULL); cl_assert(entry->file_size == strlen(AUTOMERGEABLE_MERGED_FILE)); - cl_git_pass(git_object_lookup((git_object **)&blob, repo, &entry->oid, GIT_OBJ_BLOB)); + cl_git_pass(git_object_lookup((git_object **)&blob, repo, &entry->id, GIT_OBJ_BLOB)); cl_assert(memcmp(git_blob_rawcontent(blob), AUTOMERGEABLE_MERGED_FILE, (size_t)entry->file_size) == 0); git_index_free(index); @@ -131,7 +109,7 @@ void test_merge_trees_automerge__automerge(void) void test_merge_trees_automerge__favor_ours(void) { git_index *index; - git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; struct merge_index_entry merge_index_entries[] = { ADDED_IN_MASTER_INDEX_ENTRY, @@ -149,7 +127,7 @@ void test_merge_trees_automerge__favor_ours(void) REMOVED_IN_MASTER_REUC_ENTRY, }; - opts.automerge_flags = GIT_MERGE_AUTOMERGE_FAVOR_OURS; + opts.file_favor = GIT_MERGE_FILE_FAVOR_OURS; cl_git_pass(merge_trees_from_branches(&index, repo, "master", THEIRS_AUTOMERGE_BRANCH, &opts)); @@ -162,7 +140,7 @@ void test_merge_trees_automerge__favor_ours(void) void test_merge_trees_automerge__favor_theirs(void) { git_index *index; - git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; struct merge_index_entry merge_index_entries[] = { ADDED_IN_MASTER_INDEX_ENTRY, @@ -180,7 +158,7 @@ void test_merge_trees_automerge__favor_theirs(void) REMOVED_IN_MASTER_REUC_ENTRY, }; - opts.automerge_flags = GIT_MERGE_AUTOMERGE_FAVOR_THEIRS; + opts.file_favor = GIT_MERGE_FILE_FAVOR_THEIRS; cl_git_pass(merge_trees_from_branches(&index, repo, "master", THEIRS_AUTOMERGE_BRANCH, &opts)); @@ -193,7 +171,7 @@ void test_merge_trees_automerge__favor_theirs(void) void test_merge_trees_automerge__unrelated(void) { git_index *index; - git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; struct merge_index_entry merge_index_entries[] = { { 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" }, |