summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-08-29 18:19:56 +0200
committerVicent Marti <vicent@github.com>2014-08-29 18:19:56 +0200
commit46a13f32472741f0ed66db7cb75c8cff279886ad (patch)
tree9faad1600432d9f014fedf4775d3f99359937e9d /tests
parentd99c8ca1783cfd04869e88f8707c036fc6053a05 (diff)
parent7db0e6ee48fd68009a7e78cbcbca125d6ce9008d (diff)
downloadlibgit2-46a13f32472741f0ed66db7cb75c8cff279886ad.tar.gz
Merge pull request #2481 from libgit2/cmn/oidarray
merge: expose multiple merge bases
Diffstat (limited to 'tests')
-rw-r--r--tests/revwalk/mergebase.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/revwalk/mergebase.c b/tests/revwalk/mergebase.c
index 8f1f6ef21..677e1a1b6 100644
--- a/tests/revwalk/mergebase.c
+++ b/tests/revwalk/mergebase.c
@@ -135,6 +135,24 @@ void test_revwalk_mergebase__prefer_youngest_merge_base(void)
cl_assert_equal_oid(&expected, &result);
}
+void test_revwalk_mergebase__multiple_merge_bases(void)
+{
+ git_oid one, two, expected1, expected2;
+ git_oidarray result = {NULL, 0};
+
+ cl_git_pass(git_oid_fromstr(&one, "a4a7dce85cf63874e984719f4fdd239f5145052f "));
+ cl_git_pass(git_oid_fromstr(&two, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&expected1, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
+ cl_git_pass(git_oid_fromstr(&expected2, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
+
+ cl_git_pass(git_merge_bases(&result, _repo, &one, &two));
+ cl_assert_equal_i(2, result.count);
+ cl_assert_equal_oid(&expected1, &result.ids[0]);
+ cl_assert_equal_oid(&expected2, &result.ids[1]);
+
+ git_oidarray_free(&result);
+}
+
void test_revwalk_mergebase__no_off_by_one_missing(void)
{
git_oid result, one, two;