Commit 07fb67f9 by Carlos Martín Nieto

merge: reverse array and length parameter order

Make it pair up with the one for commits. This fixes #1691.
parent 92d19d16
...@@ -85,15 +85,15 @@ GIT_EXTERN(int) git_merge_base( ...@@ -85,15 +85,15 @@ GIT_EXTERN(int) git_merge_base(
* *
* @param out the OID of a merge base considering all the commits * @param out the OID of a merge base considering all the commits
* @param repo the repository where the commits exist * @param repo the repository where the commits exist
* @param input_array oids of the commits
* @param length The number of commits in the provided `input_array` * @param length The number of commits in the provided `input_array`
* @param input_array oids of the commits
* @return Zero on success; GIT_ENOTFOUND or -1 on failure. * @return Zero on success; GIT_ENOTFOUND or -1 on failure.
*/ */
GIT_EXTERN(int) git_merge_base_many( GIT_EXTERN(int) git_merge_base_many(
git_oid *out, git_oid *out,
git_repository *repo, git_repository *repo,
const git_oid input_array[], size_t length,
size_t length); const git_oid input_array[]);
/** /**
* Creates a `git_merge_head` from the given reference * Creates a `git_merge_head` from the given reference
......
...@@ -58,7 +58,7 @@ struct merge_diff_df_data { ...@@ -58,7 +58,7 @@ struct merge_diff_df_data {
/* Merge base computation */ /* Merge base computation */
int git_merge_base_many(git_oid *out, git_repository *repo, const git_oid input_array[], size_t length) int git_merge_base_many(git_oid *out, git_repository *repo, size_t length, const git_oid input_array[])
{ {
git_revwalk *walk; git_revwalk *walk;
git_vector list; git_vector list;
......
...@@ -172,9 +172,9 @@ static void assert_mergebase_many(const char *expected_sha, int count, ...) ...@@ -172,9 +172,9 @@ static void assert_mergebase_many(const char *expected_sha, int count, ...)
va_end(ap); va_end(ap);
if (expected_sha == NULL) if (expected_sha == NULL)
cl_assert_equal_i(GIT_ENOTFOUND, git_merge_base_many(&oid, _repo, oids, count)); cl_assert_equal_i(GIT_ENOTFOUND, git_merge_base_many(&oid, _repo, count, oids));
else { else {
cl_git_pass(git_merge_base_many(&oid, _repo, oids, count)); cl_git_pass(git_merge_base_many(&oid, _repo, count, oids));
cl_git_pass(git_oid_fromstr(&expected, expected_sha)); cl_git_pass(git_oid_fromstr(&expected, expected_sha));
cl_assert(git_oid_cmp(&expected, &oid) == 0); cl_assert(git_oid_cmp(&expected, &oid) == 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