summaryrefslogtreecommitdiff
path: root/tests/merge
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-03-18 13:14:09 -0700
committerEdward Thomson <ethomson@microsoft.com>2014-03-20 09:25:10 -0700
commit97f3462ae699fae370cfa410ed58eb869ae6b276 (patch)
tree840b573fa746fd895086dd5d39d3de422cc165b2 /tests/merge
parentd9fdee6e4cb87e4531d9ddba92b44e5323e794da (diff)
downloadlibgit2-97f3462ae699fae370cfa410ed58eb869ae6b276.tar.gz
git_merge_status -> git_merge_analysis
Diffstat (limited to 'tests/merge')
-rw-r--r--tests/merge/workdir/analysis.c (renamed from tests/merge/workdir/status.c)45
1 files changed, 23 insertions, 22 deletions
diff --git a/tests/merge/workdir/status.c b/tests/merge/workdir/analysis.c
index 589299eff..6a4b86d26 100644
--- a/tests/merge/workdir/status.c
+++ b/tests/merge/workdir/analysis.c
@@ -23,67 +23,68 @@ static git_index *repo_index;
// Fixture setup and teardown
-void test_merge_workdir_status__initialize(void)
+void test_merge_workdir_analysis__initialize(void)
{
repo = cl_git_sandbox_init(TEST_REPO_PATH);
git_repository_index(&repo_index, repo);
}
-void test_merge_workdir_status__cleanup(void)
+void test_merge_workdir_analysis__cleanup(void)
{
git_index_free(repo_index);
cl_git_sandbox_cleanup();
}
-static git_status_t status_from_branch(const char *branchname)
+static git_merge_analysis_t analysis_from_branch(const char *branchname)
{
git_buf refname = GIT_BUF_INIT;
git_reference *their_ref;
git_merge_head *their_heads[1];
- git_status_t status;
+ git_merge_analysis_t analysis;
git_buf_printf(&refname, "%s%s", GIT_REFS_HEADS_DIR, branchname);
cl_git_pass(git_reference_lookup(&their_ref, repo, git_buf_cstr(&refname)));
cl_git_pass(git_merge_head_from_ref(&their_heads[0], repo, their_ref));
- cl_git_pass(git_merge_status(&status, repo, their_heads, 1));
+ cl_git_pass(git_merge_analysis(&analysis, repo, their_heads, 1));
git_buf_free(&refname);
git_merge_head_free(their_heads[0]);
git_reference_free(their_ref);
- return status;
+ return analysis;
}
-void test_merge_workdir_status__fastforward(void)
+void test_merge_workdir_analysis__fastforward(void)
{
- git_merge_status_t status;
+ git_merge_analysis_t analysis;
- status = status_from_branch(FASTFORWARD_BRANCH);
- cl_assert_equal_i(GIT_MERGE_STATUS_FASTFORWARD, status);
+ analysis = analysis_from_branch(FASTFORWARD_BRANCH);
+ cl_assert_equal_i(GIT_MERGE_ANALYSIS_FASTFORWARD, (analysis & GIT_MERGE_ANALYSIS_FASTFORWARD));
+ cl_assert_equal_i(GIT_MERGE_ANALYSIS_NORMAL, (analysis & GIT_MERGE_ANALYSIS_NORMAL));
}
-void test_merge_workdir_status__no_fastforward(void)
+void test_merge_workdir_analysis__no_fastforward(void)
{
- git_merge_status_t status;
+ git_merge_analysis_t analysis;
- status = status_from_branch(NOFASTFORWARD_BRANCH);
- cl_assert_equal_i(GIT_MERGE_STATUS_NORMAL, status);
+ analysis = analysis_from_branch(NOFASTFORWARD_BRANCH);
+ cl_assert_equal_i(GIT_MERGE_ANALYSIS_NORMAL, analysis);
}
-void test_merge_workdir_status__uptodate(void)
+void test_merge_workdir_analysis__uptodate(void)
{
- git_merge_status_t status;
+ git_merge_analysis_t analysis;
- status = status_from_branch(UPTODATE_BRANCH);
- cl_assert_equal_i(GIT_MERGE_STATUS_UP_TO_DATE, status);
+ analysis = analysis_from_branch(UPTODATE_BRANCH);
+ cl_assert_equal_i(GIT_MERGE_ANALYSIS_UP_TO_DATE, analysis);
}
-void test_merge_workdir_status__uptodate_merging_prev_commit(void)
+void test_merge_workdir_analysis__uptodate_merging_prev_commit(void)
{
- git_merge_status_t status;
+ git_merge_analysis_t analysis;
- status = status_from_branch(PREVIOUS_BRANCH);
- cl_assert_equal_i(GIT_MERGE_STATUS_UP_TO_DATE, status);
+ analysis = analysis_from_branch(PREVIOUS_BRANCH);
+ cl_assert_equal_i(GIT_MERGE_ANALYSIS_UP_TO_DATE, analysis);
}