diff options
author | Arthur Schreiber <schreiber.arthur@googlemail.com> | 2013-06-26 00:55:13 +0400 |
---|---|---|
committer | Arthur Schreiber <schreiber.arthur@googlemail.com> | 2013-06-26 00:55:13 +0400 |
commit | 24ba6d3f8cec2524a3e18157dd9149bbfb654650 (patch) | |
tree | e33edfde2c744149e66c839beb34ba14fd9a684a /tests-clar/revwalk | |
parent | 3736b64f0520f1fb0c79cf6ef29eeca7507c167c (diff) |
Add a test case.
Diffstat (limited to 'tests-clar/revwalk')
-rw-r--r-- | tests-clar/revwalk/mergebase.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests-clar/revwalk/mergebase.c b/tests-clar/revwalk/mergebase.c index e2617ab0e..a2dbbc738 100644 --- a/tests-clar/revwalk/mergebase.c +++ b/tests-clar/revwalk/mergebase.c @@ -123,6 +123,18 @@ void test_revwalk_mergebase__no_common_ancestor_returns_ENOTFOUND(void) cl_assert_equal_sz(4, behind); } +void test_revwalk_mergebase__prefer_youngest_merge_base(void) +{ + git_oid result, one, two, expected; + + cl_git_pass(git_oid_fromstr(&one, "a4a7dce85cf63874e984719f4fdd239f5145052f ")); + cl_git_pass(git_oid_fromstr(&two, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); + cl_git_pass(git_oid_fromstr(&expected, "c47800c7266a2be04c571c04d5a6614691ea99bd")); + + cl_git_pass(git_merge_base(&result, _repo, &one, &two)); + cl_assert(git_oid_cmp(&result, &expected) == 0); +} + void test_revwalk_mergebase__no_off_by_one_missing(void) { git_oid result, one, two; |