diff options
Diffstat (limited to 'tests/rebase/abort.c')
-rw-r--r-- | tests/rebase/abort.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/tests/rebase/abort.c b/tests/rebase/abort.c index c6d27f19d..71326433f 100644 --- a/tests/rebase/abort.c +++ b/tests/rebase/abort.c @@ -2,6 +2,7 @@ #include "git2/rebase.h" #include "merge.h" #include "posix.h" +#include "annotated_commit.h" #include <fcntl.h> @@ -18,7 +19,7 @@ void test_rebase_abort__cleanup(void) cl_git_sandbox_cleanup(); } -static void test_abort(git_merge_head *branch, git_merge_head *onto) +static void test_abort(git_annotated_commit *branch, git_annotated_commit *onto) { git_rebase *rebase; git_reference *head_ref, *branch_ref = NULL; @@ -37,11 +38,11 @@ static void test_abort(git_merge_head *branch, git_merge_head *onto) cl_git_pass(git_reference_lookup(&head_ref, repo, "HEAD")); if (branch->ref_name == NULL) - cl_assert_equal_oid(git_merge_head_id(branch), git_reference_target(head_ref)); + cl_assert_equal_oid(git_annotated_commit_id(branch), git_reference_target(head_ref)); else { cl_assert_equal_s("refs/heads/beef", git_reference_symbolic_target(head_ref)); cl_git_pass(git_reference_lookup(&branch_ref, repo, git_reference_symbolic_target(head_ref))); - cl_assert_equal_oid(git_merge_head_id(branch), git_reference_target(branch_ref)); + cl_assert_equal_oid(git_annotated_commit_id(branch), git_reference_target(branch_ref)); } git_status_list_new(&statuslist, repo, NULL); @@ -52,8 +53,8 @@ static void test_abort(git_merge_head *branch, git_merge_head *onto) cl_git_pass(git_reflog_read(&reflog, repo, "HEAD")); cl_assert(reflog_entry = git_reflog_entry_byindex(reflog, 0)); - cl_assert_equal_oid(git_merge_head_id(onto), git_reflog_entry_id_old(reflog_entry)); - cl_assert_equal_oid(git_merge_head_id(branch), git_reflog_entry_id_new(reflog_entry)); + cl_assert_equal_oid(git_annotated_commit_id(onto), git_reflog_entry_id_old(reflog_entry)); + cl_assert_equal_oid(git_annotated_commit_id(branch), git_reflog_entry_id_new(reflog_entry)); cl_assert_equal_s("rebase: aborting", git_reflog_entry_message(reflog_entry)); git_reflog_free(reflog); @@ -68,13 +69,13 @@ void test_rebase_abort__merge(void) git_rebase *rebase; git_reference *branch_ref, *onto_ref; git_signature *signature; - git_merge_head *branch_head, *onto_head; + git_annotated_commit *branch_head, *onto_head; cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&onto_ref, repo, "refs/heads/master")); - cl_git_pass(git_merge_head_from_ref(&branch_head, repo, branch_ref)); - cl_git_pass(git_merge_head_from_ref(&onto_head, repo, onto_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&onto_head, repo, onto_ref)); cl_git_pass(git_signature_new(&signature, "Rebaser", "rebaser@example.com", 1404157834, -400)); @@ -85,8 +86,8 @@ void test_rebase_abort__merge(void) git_signature_free(signature); - git_merge_head_free(branch_head); - git_merge_head_free(onto_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(onto_head); git_reference_free(branch_ref); git_reference_free(onto_ref); @@ -99,13 +100,13 @@ void test_rebase_abort__detached_head(void) git_oid branch_id; git_reference *onto_ref; git_signature *signature; - git_merge_head *branch_head, *onto_head; + git_annotated_commit *branch_head, *onto_head; git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64"); cl_git_pass(git_reference_lookup(&onto_ref, repo, "refs/heads/master")); - cl_git_pass(git_merge_head_from_id(&branch_head, repo, &branch_id)); - cl_git_pass(git_merge_head_from_ref(&onto_head, repo, onto_ref)); + cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id)); + cl_git_pass(git_annotated_commit_from_ref(&onto_head, repo, onto_ref)); cl_git_pass(git_signature_new(&signature, "Rebaser", "rebaser@example.com", 1404157834, -400)); @@ -116,8 +117,8 @@ void test_rebase_abort__detached_head(void) git_signature_free(signature); - git_merge_head_free(branch_head); - git_merge_head_free(onto_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(onto_head); git_reference_free(onto_ref); git_rebase_free(rebase); @@ -128,13 +129,13 @@ void test_rebase_abort__old_style_head_file(void) git_rebase *rebase; git_reference *branch_ref, *onto_ref; git_signature *signature; - git_merge_head *branch_head, *onto_head; + git_annotated_commit *branch_head, *onto_head; cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&onto_ref, repo, "refs/heads/master")); - cl_git_pass(git_merge_head_from_ref(&branch_head, repo, branch_ref)); - cl_git_pass(git_merge_head_from_ref(&onto_head, repo, onto_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&onto_head, repo, onto_ref)); cl_git_pass(git_signature_new(&signature, "Rebaser", "rebaser@example.com", 1404157834, -400)); @@ -148,8 +149,8 @@ void test_rebase_abort__old_style_head_file(void) git_signature_free(signature); - git_merge_head_free(branch_head); - git_merge_head_free(onto_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(onto_head); git_reference_free(branch_ref); git_reference_free(onto_ref); |