diff options
author | Edward Thomson <ethomson@microsoft.com> | 2015-02-18 22:53:40 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-05-11 14:11:56 -0400 |
commit | 9ebb5a3ff31a58a25714fbc98704b0fda0982cdb (patch) | |
tree | 0de9c60e6a7cb879ba05870d72fa4be9a464b1ca /tests | |
parent | bf8dd3f53d25b7f6032b971d3d73931da05982cb (diff) | |
download | libgit2-9ebb5a3ff31a58a25714fbc98704b0fda0982cdb.tar.gz |
merge: merge iterators
Diffstat (limited to 'tests')
-rw-r--r-- | tests/merge/trees/treediff.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/merge/trees/treediff.c b/tests/merge/trees/treediff.c index eea651de0..b96c4c4db 100644 --- a/tests/merge/trees/treediff.c +++ b/tests/merge/trees/treediff.c @@ -43,6 +43,7 @@ static void test_find_differences( git_merge_diff_list *merge_diff_list = git_merge_diff_list__alloc(repo); git_oid ancestor_oid, ours_oid, theirs_oid; git_tree *ancestor_tree, *ours_tree, *theirs_tree; + git_iterator *ancestor_iter, *ours_iter, *theirs_iter; git_merge_options opts = GIT_MERGE_OPTIONS_INIT; opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; @@ -66,7 +67,14 @@ static void test_find_differences( cl_git_pass(git_tree_lookup(&ours_tree, repo, &ours_oid)); cl_git_pass(git_tree_lookup(&theirs_tree, repo, &theirs_oid)); - cl_git_pass(git_merge_diff_list__find_differences(merge_diff_list, ancestor_tree, ours_tree, theirs_tree)); + cl_git_pass(git_iterator_for_tree(&ancestor_iter, ancestor_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + cl_git_pass(git_iterator_for_tree(&ours_iter, ours_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + cl_git_pass(git_iterator_for_tree(&theirs_iter, theirs_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + + cl_git_pass(git_merge_diff_list__find_differences(merge_diff_list, ancestor_iter, ours_iter, theirs_iter)); cl_git_pass(git_merge_diff_list__find_renames(repo, merge_diff_list, &opts)); /* @@ -77,6 +85,10 @@ static void test_find_differences( cl_assert(merge_test_merge_conflicts(&merge_diff_list->conflicts, treediff_conflict_data, treediff_conflict_data_len)); + git_iterator_free(ancestor_iter); + git_iterator_free(ours_iter); + git_iterator_free(theirs_iter); + git_tree_free(ancestor_tree); git_tree_free(ours_tree); git_tree_free(theirs_tree); |