diff options
author | Edward Thomson <ethomson@microsoft.com> | 2014-10-03 19:02:29 -0400 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2014-10-26 22:59:48 -0400 |
commit | 18b00406c6427eb8c9d96864448474e1d85017de (patch) | |
tree | ee02fd12ee4b8f84e5ed53ca59ac771734bba16e /tests/rebase | |
parent | 796b03bd4969f170d8e7a7c9edd567f636b58cb3 (diff) | |
download | libgit2-18b00406c6427eb8c9d96864448474e1d85017de.tar.gz |
s/git_merge_head/git_annotated_commit
Rename git_merge_head to git_annotated_commit, as it becomes used
in more operations than just merge.
Diffstat (limited to 'tests/rebase')
-rw-r--r-- | tests/rebase/abort.c | 41 | ||||
-rw-r--r-- | tests/rebase/iterator.c | 10 | ||||
-rw-r--r-- | tests/rebase/merge.c | 82 | ||||
-rw-r--r-- | tests/rebase/setup.c | 74 |
4 files changed, 104 insertions, 103 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); diff --git a/tests/rebase/iterator.c b/tests/rebase/iterator.c index cfc6dce7b..ddf4413d3 100644 --- a/tests/rebase/iterator.c +++ b/tests/rebase/iterator.c @@ -49,7 +49,7 @@ void test_rebase_iterator__iterates(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; @@ -60,8 +60,8 @@ void test_rebase_iterator__iterates(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); test_operations(rebase, 0); @@ -100,8 +100,8 @@ void test_rebase_iterator__iterates(void) cl_assert_equal_i(GIT_ITEROVER, error); test_operations(rebase, 4); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); diff --git a/tests/rebase/merge.c b/tests/rebase/merge.c index 80ca88b09..e7eb16713 100644 --- a/tests/rebase/merge.c +++ b/tests/rebase/merge.c @@ -26,7 +26,7 @@ void test_rebase_merge__next(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_status_list *status_list; @@ -38,8 +38,8 @@ void test_rebase_merge__next(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -62,8 +62,8 @@ void test_rebase_merge__next(void) cl_assert_equal_oid(&file1_id, &status_entry->head_to_index->new_file.id); git_status_list_free(status_list); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -73,7 +73,7 @@ void test_rebase_merge__next_with_conflicts(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_status_list *status_list; @@ -105,8 +105,8 @@ void test_rebase_merge__next_with_conflicts(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/asparagus")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -128,8 +128,8 @@ void test_rebase_merge__next_with_conflicts(void) cl_assert_equal_file(expected_merge, strlen(expected_merge), "rebase/asparagus.txt"); git_status_list_free(status_list); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -139,7 +139,7 @@ void test_rebase_merge__next_stops_with_iterover(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; @@ -150,8 +150,8 @@ void test_rebase_merge__next_stops_with_iterover(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -181,8 +181,8 @@ void test_rebase_merge__next_stops_with_iterover(void) cl_assert_equal_file("5\n", 2, "rebase/.git/rebase-merge/end"); cl_assert_equal_file("5\n", 2, "rebase/.git/rebase-merge/msgnum"); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -192,7 +192,7 @@ void test_rebase_merge__commit(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id, tree_id, parent_id; @@ -206,8 +206,8 @@ void test_rebase_merge__commit(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -243,8 +243,8 @@ void test_rebase_merge__commit(void) git_reflog_free(reflog); git_signature_free(author); git_commit_free(commit); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -254,7 +254,7 @@ void test_rebase_merge__commit_updates_rewritten(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; @@ -264,8 +264,8 @@ void test_rebase_merge__commit_updates_rewritten(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -282,8 +282,8 @@ void test_rebase_merge__commit_updates_rewritten(void) "8d1f13f93c4995760ac07d129246ac1ff64c0be9 ba1f9b4fd5cf8151f7818be2111cc0869f1eb95a\n", 164, "rebase/.git/rebase-merge/rewritten"); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -293,7 +293,7 @@ void test_rebase_merge__commit_drops_already_applied(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; @@ -304,8 +304,8 @@ void test_rebase_merge__commit_drops_already_applied(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/green_pea")); - cl_git_pass(git_merge_head_from_ref(&branch_head, repo, branch_ref)); - cl_git_pass(git_merge_head_from_ref(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -323,8 +323,8 @@ void test_rebase_merge__commit_drops_already_applied(void) "8d1f13f93c4995760ac07d129246ac1ff64c0be9 2ac4fb7b74c1287f6c792acad759e1ec01e18dae\n", 82, "rebase/.git/rebase-merge/rewritten"); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -334,7 +334,7 @@ void test_rebase_merge__finish(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref, *head_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; @@ -347,8 +347,8 @@ void test_rebase_merge__finish(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/gravy")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/veal")); - cl_git_pass(git_merge_head_from_ref(&branch_head, repo, branch_ref)); - cl_git_pass(git_merge_head_from_ref(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -377,13 +377,13 @@ void test_rebase_merge__finish(void) cl_git_pass(git_reflog_read(&reflog, repo, "refs/heads/gravy")); cl_assert(reflog_entry = git_reflog_entry_byindex(reflog, 0)); - cl_assert_equal_oid(git_merge_head_id(branch_head), git_reflog_entry_id_old(reflog_entry)); + cl_assert_equal_oid(git_annotated_commit_id(branch_head), git_reflog_entry_id_old(reflog_entry)); cl_assert_equal_oid(&commit_id, git_reflog_entry_id_new(reflog_entry)); cl_assert_equal_s("rebase finished: refs/heads/gravy onto f87d14a4a236582a0278a916340a793714256864", git_reflog_entry_message(reflog_entry)); git_reflog_free(reflog); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(head_ref); git_reference_free(branch_ref); git_reference_free(upstream_ref); @@ -396,7 +396,7 @@ static void test_copy_note( { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_commit *branch_commit; git_rebase_operation *rebase_operation; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; @@ -409,8 +409,8 @@ static void test_copy_note( cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/gravy")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/veal")); - cl_git_pass(git_merge_head_from_ref(&branch_head, repo, branch_ref)); - cl_git_pass(git_merge_head_from_ref(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_reference_peel((git_object **)&branch_commit, branch_ref, GIT_OBJ_COMMIT)); @@ -442,8 +442,8 @@ static void test_copy_note( git_note_free(note); git_commit_free(branch_commit); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); diff --git a/tests/rebase/setup.c b/tests/rebase/setup.c index e72075a88..c81ca1245 100644 --- a/tests/rebase/setup.c +++ b/tests/rebase/setup.c @@ -29,15 +29,15 @@ void test_rebase_setup__blocked_when_in_progress(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo)); cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); git_rebase_free(rebase); @@ -46,8 +46,8 @@ void test_rebase_setup__blocked_when_in_progress(void) cl_git_fail(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); } @@ -57,7 +57,7 @@ void test_rebase_setup__merge(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_reference *head; git_commit *head_commit; git_oid head_id; @@ -67,8 +67,8 @@ void test_rebase_setup__merge(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -93,8 +93,8 @@ void test_rebase_setup__merge(void) git_commit_free(head_commit); git_reference_free(head); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -105,7 +105,7 @@ void test_rebase_setup__merge_root(void) { git_rebase *rebase; git_reference *branch_ref, *onto_ref; - git_merge_head *branch_head, *onto_head; + git_annotated_commit *branch_head, *onto_head; git_reference *head; git_commit *head_commit; git_oid head_id; @@ -115,8 +115,8 @@ void test_rebase_setup__merge_root(void) 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_rebase_init(&rebase, repo, branch_head, NULL, onto_head, signature, NULL)); @@ -141,8 +141,8 @@ void test_rebase_setup__merge_root(void) git_commit_free(head_commit); git_reference_free(head); - 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); git_rebase_free(rebase); @@ -153,7 +153,7 @@ void test_rebase_setup__merge_onto_and_upstream(void) { git_rebase *rebase; git_reference *branch1_ref, *branch2_ref, *onto_ref; - git_merge_head *branch1_head, *branch2_head, *onto_head; + git_annotated_commit *branch1_head, *branch2_head, *onto_head; git_reference *head; git_commit *head_commit; git_oid head_id; @@ -164,9 +164,9 @@ void test_rebase_setup__merge_onto_and_upstream(void) cl_git_pass(git_reference_lookup(&branch2_ref, repo, "refs/heads/veal")); cl_git_pass(git_reference_lookup(&onto_ref, repo, "refs/heads/master")); - cl_git_pass(git_merge_head_from_ref(&branch1_head, repo, branch1_ref)); - cl_git_pass(git_merge_head_from_ref(&branch2_head, repo, branch2_ref)); - cl_git_pass(git_merge_head_from_ref(&onto_head, repo, onto_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch1_head, repo, branch1_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch2_head, repo, branch2_ref)); + cl_git_pass(git_annotated_commit_from_ref(&onto_head, repo, onto_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch1_head, branch2_head, onto_head, signature, NULL)); @@ -187,9 +187,9 @@ void test_rebase_setup__merge_onto_and_upstream(void) git_commit_free(head_commit); git_reference_free(head); - git_merge_head_free(branch1_head); - git_merge_head_free(branch2_head); - git_merge_head_free(onto_head); + git_annotated_commit_free(branch1_head); + git_annotated_commit_free(branch2_head); + git_annotated_commit_free(onto_head); git_reference_free(branch1_ref); git_reference_free(branch2_ref); git_reference_free(onto_ref); @@ -202,7 +202,7 @@ void test_rebase_setup__branch_with_merges(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_reference *head; git_commit *head_commit; git_oid head_id; @@ -212,8 +212,8 @@ void test_rebase_setup__branch_with_merges(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/veal")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -238,8 +238,8 @@ void test_rebase_setup__branch_with_merges(void) git_commit_free(head_commit); git_reference_free(head); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -250,7 +250,7 @@ void test_rebase_setup__orphan_branch(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; git_reference *head; git_commit *head_commit; git_oid head_id; @@ -260,8 +260,8 @@ void test_rebase_setup__orphan_branch(void) cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/barley")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); @@ -286,8 +286,8 @@ void test_rebase_setup__orphan_branch(void) git_commit_free(head_commit); git_reference_free(head); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); git_rebase_free(rebase); @@ -299,20 +299,20 @@ static int rebase_is_blocked(void) int error; git_reference *branch_ref, *upstream_ref; - git_merge_head *branch_head, *upstream_head; + git_annotated_commit *branch_head, *upstream_head; cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo)); cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_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(&upstream_head, repo, upstream_ref)); + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); error = git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL); - git_merge_head_free(branch_head); - git_merge_head_free(upstream_head); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); git_reference_free(branch_ref); git_reference_free(upstream_ref); |