Commit 8d453f16 by lhchavez

Swap the order of the `git_graph_reachable_from_any` params

len, array -> array, len
parent ce5400cd
......@@ -68,8 +68,8 @@ GIT_EXTERN(int) git_graph_descendant_of(
GIT_EXTERN(int) git_graph_reachable_from_any(
git_repository *repo,
const git_oid *commit,
size_t length,
const git_oid descendant_array[]);
const git_oid descendant_array[],
size_t length);
/** @} */
GIT_END_DECL
......
......@@ -179,14 +179,14 @@ int git_graph_descendant_of(git_repository *repo, const git_oid *commit, const g
if (git_oid_equal(commit, ancestor))
return 0;
return git_graph_reachable_from_any(repo, ancestor, 1, commit);
return git_graph_reachable_from_any(repo, ancestor, commit, 1);
}
int git_graph_reachable_from_any(
git_repository *repo,
const git_oid *commit_id,
size_t length,
const git_oid descendant_array[])
const git_oid descendant_array[],
size_t length)
{
git_revwalk *walk = NULL;
git_vector list;
......
......@@ -45,11 +45,11 @@ void test_graph_reachable_from_any__returns_correct_result(void)
cl_assert_equal_i(
git_graph_reachable_from_any(
repo, git_object_id(branchH1), 1, git_object_id(branchA1)),
repo, git_object_id(branchH1), git_object_id(branchA1), 1),
0);
cl_assert_equal_i(
git_graph_reachable_from_any(
repo, git_object_id(branchH1), 1, git_object_id(branchA2)),
repo, git_object_id(branchH1), git_object_id(branchA2), 1),
0);
cl_git_pass(git_oid_cpy(&descendants[0], git_object_id(branchA1)));
......@@ -60,10 +60,10 @@ void test_graph_reachable_from_any__returns_correct_result(void)
cl_git_pass(git_oid_cpy(&descendants[5], git_object_id(branchC2)));
cl_git_pass(git_oid_cpy(&descendants[6], git_object_id(branchH2)));
cl_assert_equal_i(
git_graph_reachable_from_any(repo, git_object_id(branchH2), 6, descendants),
git_graph_reachable_from_any(repo, git_object_id(branchH2), descendants, 6),
0);
cl_assert_equal_i(
git_graph_reachable_from_any(repo, git_object_id(branchH2), 7, descendants),
git_graph_reachable_from_any(repo, git_object_id(branchH2), descendants, 7),
1);
git_object_free(branchA1);
......@@ -197,8 +197,8 @@ void test_graph_reachable_from_any__exhaustive(void)
actual_reachable = git_graph_reachable_from_any(
repo,
git_commit_id(parent_commit),
n_descendants,
descendants);
descendants,
n_descendants);
if (actual_reachable != expected_reachable) {
git_buf error_message_buf = GIT_BUF_INIT;
char parent_oidbuf[9] = {0}, child_oidbuf[9] = {0};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment