diff options
author | Scott J. Goldman <scottjg@github.com> | 2012-12-09 21:04:32 -0800 |
---|---|---|
committer | Scott J. Goldman <scottjg@github.com> | 2012-12-09 21:04:32 -0800 |
commit | b337814e70a836fe6611df4a10032fd01ed713a3 (patch) | |
tree | a1a5f93d57f1cd714483b736c5604f3f553f3934 /tests-clar/revwalk | |
parent | 9c2a4e8c4731854c602acd3c5eb46f4fc84f9f71 (diff) | |
download | libgit2-b337814e70a836fe6611df4a10032fd01ed713a3.tar.gz |
Fix no_common_ancestor test for ahead_behind count
Ahead-behind count is still a valid operation, even if the two
commits don't have a common merge-base. The old implementation was
buggy, so it returned ENOTFOUND. Fixed now.
Diffstat (limited to 'tests-clar/revwalk')
-rw-r--r-- | tests-clar/revwalk/mergebase.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests-clar/revwalk/mergebase.c b/tests-clar/revwalk/mergebase.c index 9707d42ca..8adf5fb25 100644 --- a/tests-clar/revwalk/mergebase.c +++ b/tests-clar/revwalk/mergebase.c @@ -115,10 +115,9 @@ void test_revwalk_mergebase__no_common_ancestor_returns_ENOTFOUND(void) cl_assert_equal_i(GIT_ENOTFOUND, error); - cl_git_fail(git_graph_ahead_behind(&ahead, &behind, _repo, &one, &two)); - cl_git_fail(error); - - cl_assert_equal_i(GIT_ENOTFOUND, error); + cl_git_pass(git_graph_ahead_behind(&ahead, &behind, _repo, &one, &two)); + cl_assert_equal_i(2, ahead); + cl_assert_equal_i(4, behind); } void test_revwalk_mergebase__no_off_by_one_missing(void) |