Commit a1bbc0ce by Carlos Martín Nieto

merge: rename _oid() -> id()

Following the rest of the series, use 'id' when refering to the value.
parent 86bfc3e1
...@@ -160,13 +160,13 @@ GIT_EXTERN(int) git_merge_head_from_fetchhead( ...@@ -160,13 +160,13 @@ GIT_EXTERN(int) git_merge_head_from_fetchhead(
* *
* @param out pointer to store the git_merge_head result in * @param out pointer to store the git_merge_head result in
* @param repo repository that contains the given commit * @param repo repository that contains the given commit
* @param oid the commit object id to use as a merge input * @param id the commit object id to use as a merge input
* @return zero on success, -1 on failure. * @return zero on success, -1 on failure.
*/ */
GIT_EXTERN(int) git_merge_head_from_oid( GIT_EXTERN(int) git_merge_head_from_id(
git_merge_head **out, git_merge_head **out,
git_repository *repo, git_repository *repo,
const git_oid *oid); const git_oid *id);
/** /**
* Frees a `git_merge_head` * Frees a `git_merge_head`
...@@ -251,7 +251,7 @@ GIT_EXTERN(int) git_merge_result_is_fastforward(git_merge_result *merge_result); ...@@ -251,7 +251,7 @@ GIT_EXTERN(int) git_merge_result_is_fastforward(git_merge_result *merge_result);
* @param out the OID of the fast-forward * @param out the OID of the fast-forward
* @param merge_result the results of the merge * @param merge_result the results of the merge
*/ */
GIT_EXTERN(int) git_merge_result_fastforward_oid(git_oid *out, git_merge_result *merge_result); GIT_EXTERN(int) git_merge_result_fastforward_id(git_oid *out, git_merge_result *merge_result);
GIT_EXTERN(void) git_merge_result_free(git_merge_result *merge_result); GIT_EXTERN(void) git_merge_result_free(git_merge_result *merge_result);
......
...@@ -2111,7 +2111,7 @@ static int merge_ancestor_head( ...@@ -2111,7 +2111,7 @@ static int merge_ancestor_head(
if ((error = git_merge_base_many(&ancestor_oid, repo, their_heads_len + 1, oids)) < 0) if ((error = git_merge_base_many(&ancestor_oid, repo, their_heads_len + 1, oids)) < 0)
goto on_error; goto on_error;
error = git_merge_head_from_oid(ancestor_head, repo, &ancestor_oid); error = git_merge_head_from_id(ancestor_head, repo, &ancestor_oid);
on_error: on_error:
git__free(oids); git__free(oids);
...@@ -2615,7 +2615,7 @@ int git_merge_result_is_fastforward(git_merge_result *merge_result) ...@@ -2615,7 +2615,7 @@ int git_merge_result_is_fastforward(git_merge_result *merge_result)
return merge_result->is_fastforward; return merge_result->is_fastforward;
} }
int git_merge_result_fastforward_oid(git_oid *out, git_merge_result *merge_result) int git_merge_result_fastforward_id(git_oid *out, git_merge_result *merge_result)
{ {
assert(out && merge_result); assert(out && merge_result);
...@@ -2699,7 +2699,7 @@ int git_merge_head_from_ref( ...@@ -2699,7 +2699,7 @@ int git_merge_head_from_ref(
return error; return error;
} }
int git_merge_head_from_oid( int git_merge_head_from_id(
git_merge_head **out, git_merge_head **out,
git_repository *repo, git_repository *repo,
const git_oid *oid) const git_oid *oid)
......
...@@ -13,10 +13,10 @@ static git_index *repo_index; ...@@ -13,10 +13,10 @@ static git_index *repo_index;
#define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index" #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
#define THEIRS_FASTFORWARD_BRANCH "ff_branch" #define THEIRS_FASTFORWARD_BRANCH "ff_branch"
#define THEIRS_FASTFORWARD_OID "fd89f8cffb663ac89095a0f9764902e93ceaca6a" #define THEIRS_FASTFORWARD_ID "fd89f8cffb663ac89095a0f9764902e93ceaca6a"
#define THEIRS_NOFASTFORWARD_BRANCH "branch" #define THEIRS_NOFASTFORWARD_BRANCH "branch"
#define THEIRS_NOFASTFORWARD_OID "7cb63eed597130ba4abb87b3e544b85021905520" #define THEIRS_NOFASTFORWARD_ID "7cb63eed597130ba4abb87b3e544b85021905520"
// Fixture setup and teardown // Fixture setup and teardown
...@@ -57,11 +57,11 @@ void test_merge_workdir_fastforward__fastforward(void) ...@@ -57,11 +57,11 @@ void test_merge_workdir_fastforward__fastforward(void)
git_merge_result *result; git_merge_result *result;
git_oid expected, ff_oid; git_oid expected, ff_oid;
cl_git_pass(git_oid_fromstr(&expected, THEIRS_FASTFORWARD_OID)); cl_git_pass(git_oid_fromstr(&expected, THEIRS_FASTFORWARD_ID));
cl_assert(result = merge_fastforward_branch(0)); cl_assert(result = merge_fastforward_branch(0));
cl_assert(git_merge_result_is_fastforward(result)); cl_assert(git_merge_result_is_fastforward(result));
cl_git_pass(git_merge_result_fastforward_oid(&ff_oid, result)); cl_git_pass(git_merge_result_fastforward_id(&ff_oid, result));
cl_assert(git_oid_cmp(&ff_oid, &expected) == 0); cl_assert(git_oid_cmp(&ff_oid, &expected) == 0);
git_merge_result_free(result); git_merge_result_free(result);
...@@ -136,7 +136,7 @@ void test_merge_workdir_fastforward__uptodate_merging_prev_commit(void) ...@@ -136,7 +136,7 @@ void test_merge_workdir_fastforward__uptodate_merging_prev_commit(void)
git_merge_result *result; git_merge_result *result;
cl_git_pass(git_oid_fromstr(&their_oid, "c607fc30883e335def28cd686b51f6cfa02b06ec")); cl_git_pass(git_oid_fromstr(&their_oid, "c607fc30883e335def28cd686b51f6cfa02b06ec"));
cl_git_pass(git_merge_head_from_oid(&their_heads[0], repo, &their_oid)); cl_git_pass(git_merge_head_from_id(&their_heads[0], repo, &their_oid));
cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, NULL)); cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, NULL));
......
...@@ -134,7 +134,7 @@ static git_merge_result *merge_simple_branch(int merge_file_favor, int checkout_ ...@@ -134,7 +134,7 @@ static git_merge_result *merge_simple_branch(int merge_file_favor, int checkout_
git_merge_opts opts = GIT_MERGE_OPTS_INIT; git_merge_opts opts = GIT_MERGE_OPTS_INIT;
cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_SIMPLE_OID)); cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_SIMPLE_OID));
cl_git_pass(git_merge_head_from_oid(&their_heads[0], repo, &their_oids[0])); cl_git_pass(git_merge_head_from_id(&their_heads[0], repo, &their_oids[0]));
opts.merge_tree_opts.file_favor = merge_file_favor; opts.merge_tree_opts.file_favor = merge_file_favor;
opts.checkout_opts.checkout_strategy = checkout_strategy; opts.checkout_opts.checkout_strategy = checkout_strategy;
...@@ -588,7 +588,7 @@ void test_merge_workdir_simple__directory_file(void) ...@@ -588,7 +588,7 @@ void test_merge_workdir_simple__directory_file(void)
cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD)); cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD));
cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_DIRECTORY_FILE)); cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_DIRECTORY_FILE));
cl_git_pass(git_merge_head_from_oid(&their_heads[0], repo, &their_oids[0])); cl_git_pass(git_merge_head_from_id(&their_heads[0], repo, &their_oids[0]));
opts.merge_tree_opts.file_favor = 0; opts.merge_tree_opts.file_favor = 0;
cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, &opts)); cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, &opts));
...@@ -621,7 +621,7 @@ void test_merge_workdir_simple__unrelated(void) ...@@ -621,7 +621,7 @@ void test_merge_workdir_simple__unrelated(void)
}; };
cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_PARENT)); cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_PARENT));
cl_git_pass(git_merge_head_from_oid(&their_heads[0], repo, &their_oids[0])); cl_git_pass(git_merge_head_from_id(&their_heads[0], repo, &their_oids[0]));
opts.merge_tree_opts.file_favor = 0; opts.merge_tree_opts.file_favor = 0;
cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, &opts)); cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, &opts));
...@@ -654,7 +654,7 @@ void test_merge_workdir_simple__unrelated_with_conflicts(void) ...@@ -654,7 +654,7 @@ void test_merge_workdir_simple__unrelated_with_conflicts(void)
}; };
cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_OID)); cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_OID));
cl_git_pass(git_merge_head_from_oid(&their_heads[0], repo, &their_oids[0])); cl_git_pass(git_merge_head_from_id(&their_heads[0], repo, &their_oids[0]));
opts.merge_tree_opts.file_favor = 0; opts.merge_tree_opts.file_favor = 0;
cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, &opts)); cl_git_pass(git_merge(&result, repo, (const git_merge_head **)their_heads, 1, &opts));
...@@ -686,7 +686,7 @@ void test_merge_workdir_simple__binary(void) ...@@ -686,7 +686,7 @@ void test_merge_workdir_simple__binary(void)
cl_git_pass(git_commit_lookup(&our_commit, repo, &our_oid)); cl_git_pass(git_commit_lookup(&our_commit, repo, &our_oid));
cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD)); cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD));
cl_git_pass(git_merge_head_from_oid(&their_head, repo, &their_oid)); cl_git_pass(git_merge_head_from_id(&their_head, repo, &their_oid));
cl_git_pass(git_merge(&result, repo, (const git_merge_head **)&their_head, 1, &opts)); cl_git_pass(git_merge(&result, repo, (const git_merge_head **)&their_head, 1, &opts));
......
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