diff options
Diffstat (limited to 'tests/refs')
-rw-r--r-- | tests/refs/branches/create.c | 27 | ||||
-rw-r--r-- | tests/refs/branches/delete.c | 4 | ||||
-rw-r--r-- | tests/refs/branches/ishead.c | 6 | ||||
-rw-r--r-- | tests/refs/branches/iterator.c | 4 | ||||
-rw-r--r-- | tests/refs/branches/move.c | 33 | ||||
-rw-r--r-- | tests/refs/branches/upstream.c | 2 | ||||
-rw-r--r-- | tests/refs/crashes.c | 2 | ||||
-rw-r--r-- | tests/refs/create.c | 18 | ||||
-rw-r--r-- | tests/refs/createwithlog.c | 6 | ||||
-rw-r--r-- | tests/refs/delete.c | 2 | ||||
-rw-r--r-- | tests/refs/foreachglob.c | 2 | ||||
-rw-r--r-- | tests/refs/overwrite.c | 26 | ||||
-rw-r--r-- | tests/refs/pack.c | 4 | ||||
-rw-r--r-- | tests/refs/races.c | 34 | ||||
-rw-r--r-- | tests/refs/reflog/reflog.c | 20 | ||||
-rw-r--r-- | tests/refs/rename.c | 39 | ||||
-rw-r--r-- | tests/refs/revparse.c | 10 | ||||
-rw-r--r-- | tests/refs/settargetwithlog.c | 6 | ||||
-rw-r--r-- | tests/refs/setter.c | 10 | ||||
-rw-r--r-- | tests/refs/unicode.c | 2 | ||||
-rw-r--r-- | tests/refs/update.c | 2 |
21 files changed, 123 insertions, 136 deletions
diff --git a/tests/refs/branches/create.c b/tests/refs/branches/create.c index af9963bde..4d52c7720 100644 --- a/tests/refs/branches/create.c +++ b/tests/refs/branches/create.c @@ -45,7 +45,7 @@ void test_refs_branches_create__can_create_a_local_branch(void) { retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, 0, NULL)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); } @@ -53,14 +53,14 @@ void test_refs_branches_create__can_not_create_a_branch_if_its_name_collide_with { retrieve_known_commit(&target, repo); - cl_assert_equal_i(GIT_EEXISTS, git_branch_create(&branch, repo, "br2", target, 0, NULL, NULL)); + cl_assert_equal_i(GIT_EEXISTS, git_branch_create(&branch, repo, "br2", target, 0, NULL)); } void test_refs_branches_create__can_force_create_over_an_existing_branch(void) { retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, "br2", target, 1, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "br2", target, 1, NULL)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_assert_equal_s("refs/heads/br2", git_reference_name(branch)); } @@ -76,7 +76,7 @@ void test_refs_branches_create__cannot_force_create_over_current_branch(void) cl_assert_equal_i(true, git_branch_is_head(branch2)); oid = git_reference_target(branch2); - cl_git_fail_with(-1, git_branch_create(&branch, repo, "master", target, 1, NULL, NULL)); + cl_git_fail_with(-1, git_branch_create(&branch, repo, "master", target, 1, NULL)); branch = NULL; cl_git_pass(git_branch_lookup(&branch, repo, "master", GIT_BRANCH_LOCAL)); cl_assert_equal_s("refs/heads/master", git_reference_name(branch)); @@ -89,7 +89,7 @@ void test_refs_branches_create__creating_a_branch_with_an_invalid_name_returns_E retrieve_known_commit(&target, repo); cl_assert_equal_i(GIT_EINVALIDSPEC, - git_branch_create(&branch, repo, "inv@{id", target, 0, NULL, NULL)); + git_branch_create(&branch, repo, "inv@{id", target, 0, NULL)); } void test_refs_branches_create__creation_creates_new_reflog(void) @@ -101,13 +101,12 @@ void test_refs_branches_create__creation_creates_new_reflog(void) cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, false, sig, "create!")); + cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, false, "create!")); cl_git_pass(git_reflog_read(&log, repo, "refs/heads/" NEW_BRANCH_NAME)); cl_assert_equal_i(1, git_reflog_entrycount(log)); entry = git_reflog_entry_byindex(log, 0); cl_assert_equal_s("create!", git_reflog_entry_message(entry)); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); git_reflog_free(log); git_signature_free(sig); @@ -128,7 +127,7 @@ void test_refs_branches_create__default_reflog_message(void) cl_git_pass(git_signature_default(&sig, repo)); retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, false, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, false, NULL)); cl_git_pass(git_reflog_read(&log, repo, "refs/heads/" NEW_BRANCH_NAME)); entry = git_reflog_entry_byindex(log, 0); @@ -181,7 +180,7 @@ void test_refs_branches_create__can_create_branch_with_unicode(void) for (i = 0; i < ARRAY_SIZE(names); ++i) { const char *name; cl_git_pass(git_branch_create( - &branch, repo, names[i], target, 0, NULL, NULL)); + &branch, repo, names[i], target, 0, NULL)); cl_git_pass(git_oid_cmp( git_reference_target(branch), git_commit_id(target))); @@ -239,7 +238,7 @@ void test_refs_branches_create__name_vs_namespace(void) retrieve_known_commit(&target, repo); for (p=item; p->first; p++) { - cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0, NULL)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_git_pass(git_branch_name(&name, branch)); cl_assert_equal_s(name, p->first); @@ -248,7 +247,7 @@ void test_refs_branches_create__name_vs_namespace(void) git_reference_free(branch); branch = NULL; - cl_git_pass(git_branch_create(&branch, repo, p->second, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->second, target, 0, NULL)); git_reference_free(branch); branch = NULL; } @@ -277,7 +276,7 @@ void test_refs_branches_create__name_vs_namespace_fail(void) retrieve_known_commit(&target, repo); for (p=item; p->first; p++) { - cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0, NULL)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_git_pass(git_branch_name(&name, branch)); cl_assert_equal_s(name, p->first); @@ -286,7 +285,7 @@ void test_refs_branches_create__name_vs_namespace_fail(void) git_reference_free(branch); branch = NULL; - cl_git_pass(git_branch_create(&branch, repo, p->first_alternate, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->first_alternate, target, 0, NULL)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_git_pass(git_branch_name(&name, branch)); cl_assert_equal_s(name, p->first_alternate); @@ -295,7 +294,7 @@ void test_refs_branches_create__name_vs_namespace_fail(void) git_reference_free(branch); branch = NULL; - cl_git_fail(git_branch_create(&branch, repo, p->second, target, 0, NULL, NULL)); + cl_git_fail(git_branch_create(&branch, repo, p->second, target, 0, NULL)); git_reference_free(branch); branch = NULL; } diff --git a/tests/refs/branches/delete.c b/tests/refs/branches/delete.c index e3199e230..c52c45b24 100644 --- a/tests/refs/branches/delete.c +++ b/tests/refs/branches/delete.c @@ -13,7 +13,7 @@ void test_refs_branches_delete__initialize(void) repo = cl_git_sandbox_init("testrepo.git"); cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); - cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL)); } void test_refs_branches_delete__cleanup(void) @@ -75,7 +75,7 @@ void test_refs_branches_delete__can_delete_a_branch_pointed_at_by_detached_HEAD( git_reference_free(head); /* Detach HEAD and make it target the commit that "master" points to */ - git_repository_detach_head(repo, NULL, NULL); + git_repository_detach_head(repo, NULL); cl_git_pass(git_branch_lookup(&branch, repo, "master", GIT_BRANCH_LOCAL)); cl_git_pass(git_branch_delete(branch)); diff --git a/tests/refs/branches/ishead.c b/tests/refs/branches/ishead.c index d16a79652..1df70b789 100644 --- a/tests/refs/branches/ishead.c +++ b/tests/refs/branches/ishead.c @@ -82,9 +82,9 @@ void test_refs_branches_ishead__only_direct_references_are_considered(void) { git_reference *linked, *super, *head; - cl_git_pass(git_reference_symbolic_create(&linked, repo, "refs/heads/linked", "refs/heads/master", 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&super, repo, "refs/heads/super", "refs/heads/linked", 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, "refs/heads/super", 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&linked, repo, "refs/heads/linked", "refs/heads/master", 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&super, repo, "refs/heads/super", "refs/heads/linked", 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, "refs/heads/super", 1, NULL)); cl_assert_equal_i(false, git_branch_is_head(linked)); cl_assert_equal_i(false, git_branch_is_head(super)); diff --git a/tests/refs/branches/iterator.c b/tests/refs/branches/iterator.c index 76b35a7d6..ca366c9f3 100644 --- a/tests/refs/branches/iterator.c +++ b/tests/refs/branches/iterator.c @@ -12,7 +12,7 @@ void test_refs_branches_iterator__initialize(void) cl_git_pass(git_repository_open(&repo, "testrepo.git")); cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); - cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL)); } void test_refs_branches_iterator__cleanup(void) @@ -113,7 +113,7 @@ void test_refs_branches_iterator__retrieve_remote_symbolic_HEAD_when_present(voi }; git_reference_free(fake_remote); - cl_git_pass(git_reference_symbolic_create(&fake_remote, repo, "refs/remotes/nulltoken/HEAD", "refs/remotes/nulltoken/master", 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&fake_remote, repo, "refs/remotes/nulltoken/HEAD", "refs/remotes/nulltoken/master", 0, NULL)); assert_retrieval(GIT_BRANCH_REMOTE, 3); diff --git a/tests/refs/branches/move.c b/tests/refs/branches/move.c index f136b00d6..b78daa2e4 100644 --- a/tests/refs/branches/move.c +++ b/tests/refs/branches/move.c @@ -22,7 +22,7 @@ void test_refs_branches_move__can_move_a_local_branch(void) cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_git_pass(git_branch_move(&new_ref, original_ref, NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, NEW_BRANCH_NAME, 0, NULL)); cl_assert_equal_s(GIT_REFS_HEADS_DIR NEW_BRANCH_NAME, git_reference_name(new_ref)); git_reference_free(original_ref); @@ -36,11 +36,11 @@ void test_refs_branches_move__can_move_a_local_branch_to_a_different_namespace(v cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); /* Downward */ - cl_git_pass(git_branch_move(&new_ref, original_ref, "somewhere/" NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, "somewhere/" NEW_BRANCH_NAME, 0, NULL)); git_reference_free(original_ref); /* Upward */ - cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0, NULL)); git_reference_free(new_ref); git_reference_free(newer_ref); @@ -53,11 +53,11 @@ void test_refs_branches_move__can_move_a_local_branch_to_a_partially_colliding_n cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); /* Downward */ - cl_git_pass(git_branch_move(&new_ref, original_ref, "br2/" NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, "br2/" NEW_BRANCH_NAME, 0, NULL)); git_reference_free(original_ref); /* Upward */ - cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0, NULL)); git_reference_free(new_ref); git_reference_free(newer_ref); @@ -81,7 +81,7 @@ void test_refs_branches_move__can_not_move_a_branch_if_its_destination_name_coll cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); cl_assert_equal_i(GIT_EEXISTS, - git_branch_move(&new_ref, original_ref, "master", 0, NULL, NULL)); + git_branch_move(&new_ref, original_ref, "master", 0, NULL)); cl_assert(giterr_last()->message != NULL); cl_git_pass(git_config_get_entry(&ce, config, "branch.master.remote")); @@ -91,7 +91,7 @@ void test_refs_branches_move__can_not_move_a_branch_if_its_destination_name_coll cl_assert_equal_i(GIT_EEXISTS, - git_branch_move(&new_ref, original_ref, "cannot-fetch", 0, NULL, NULL)); + git_branch_move(&new_ref, original_ref, "cannot-fetch", 0, NULL)); cl_assert(giterr_last()->message != NULL); cl_git_pass(git_config_get_entry(&ce, config, "branch.master.remote")); @@ -103,7 +103,7 @@ void test_refs_branches_move__can_not_move_a_branch_if_its_destination_name_coll cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/track-local")); cl_assert_equal_i(GIT_EEXISTS, - git_branch_move(&new_ref, original_ref, "master", 0, NULL, NULL)); + git_branch_move(&new_ref, original_ref, "master", 0, NULL)); cl_assert(giterr_last()->message != NULL); cl_git_pass(git_config_get_entry(&ce, config, "branch.master.remote")); @@ -122,7 +122,7 @@ void test_refs_branches_move__moving_a_branch_with_an_invalid_name_returns_EINVA cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_assert_equal_i(GIT_EINVALIDSPEC, git_branch_move(&new_ref, original_ref, "Inv@{id", 0, NULL, NULL)); + cl_assert_equal_i(GIT_EINVALIDSPEC, git_branch_move(&new_ref, original_ref, "Inv@{id", 0, NULL)); git_reference_free(original_ref); } @@ -132,7 +132,7 @@ void test_refs_branches_move__can_not_move_a_non_branch(void) git_reference *tag, *new_ref; cl_git_pass(git_reference_lookup(&tag, repo, "refs/tags/e90810b")); - cl_git_fail(git_branch_move(&new_ref, tag, NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_fail(git_branch_move(&new_ref, tag, NEW_BRANCH_NAME, 0, NULL)); git_reference_free(tag); } @@ -143,7 +143,7 @@ void test_refs_branches_move__can_force_move_over_an_existing_branch(void) cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_git_pass(git_branch_move(&new_ref, original_ref, "master", 1, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, "master", 1, NULL)); git_reference_free(original_ref); git_reference_free(new_ref); @@ -161,7 +161,7 @@ void test_refs_branches_move__moving_a_branch_moves_related_configuration_data(v assert_config_entry_existence(repo, "branch.moved.remote", false); assert_config_entry_existence(repo, "branch.moved.merge", false); - cl_git_pass(git_branch_move(&new_branch, branch, "moved", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_branch, branch, "moved", 0, NULL)); git_reference_free(branch); assert_config_entry_existence(repo, "branch.track-local.remote", false); @@ -178,7 +178,7 @@ void test_refs_branches_move__moving_the_branch_pointed_at_by_HEAD_updates_HEAD( git_reference *new_branch; cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master")); - cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, NULL)); git_reference_free(branch); git_reference_free(new_branch); @@ -198,12 +198,11 @@ void test_refs_branches_move__updates_the_reflog(void) cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master")); - cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, sig, "message")); + cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, "message")); cl_git_pass(git_reflog_read(&log, repo, git_reference_name(new_branch))); entry = git_reflog_entry_byindex(log, 0); cl_assert_equal_s("message", git_reflog_entry_message(entry)); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); git_reference_free(branch); git_reference_free(new_branch); @@ -228,7 +227,7 @@ void test_refs_branches_move__default_reflog_message(void) cl_git_pass(git_signature_default(&sig, repo)); cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master")); - cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, NULL)); cl_git_pass(git_reflog_read(&log, repo, git_reference_name(new_branch))); entry = git_reflog_entry_byindex(log, 0); @@ -248,7 +247,7 @@ void test_refs_branches_move__can_move_with_unicode(void) const char *new_branch_name = "\x41\xCC\x8A\x73\x74\x72\x6F\xCC\x88\x6D"; cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_git_pass(git_branch_move(&new_ref, original_ref, new_branch_name, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, new_branch_name, 0, NULL)); if (cl_repo_get_bool(repo, "core.precomposeunicode")) cl_assert_equal_s(GIT_REFS_HEADS_DIR "\xC3\x85\x73\x74\x72\xC3\xB6\x6D", git_reference_name(new_ref)); diff --git a/tests/refs/branches/upstream.c b/tests/refs/branches/upstream.c index b20b93753..f0aef5578 100644 --- a/tests/refs/branches/upstream.c +++ b/tests/refs/branches/upstream.c @@ -91,7 +91,7 @@ static void assert_merge_and_or_remote_key_missing(git_repository *repository, c git_reference *branch; cl_assert_equal_i(GIT_OBJ_COMMIT, git_object_type((git_object*)target)); - cl_git_pass(git_branch_create(&branch, repository, entry_name, (git_commit*)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repository, entry_name, (git_commit*)target, 0, NULL)); cl_assert_equal_i(GIT_ENOTFOUND, git_branch_upstream(&upstream, branch)); diff --git a/tests/refs/crashes.c b/tests/refs/crashes.c index 03082d71e..7a10411c8 100644 --- a/tests/refs/crashes.c +++ b/tests/refs/crashes.c @@ -7,7 +7,7 @@ void test_refs_crashes__double_free(void) const char *REFNAME = "refs/heads/xxx"; cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git"))); - cl_git_pass(git_reference_symbolic_create(&ref, repo, REFNAME, "refs/heads/master", 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, repo, REFNAME, "refs/heads/master", 0, NULL)); cl_git_pass(git_reference_lookup(&ref2, repo, REFNAME)); cl_git_pass(git_reference_delete(ref)); git_reference_free(ref); diff --git a/tests/refs/create.c b/tests/refs/create.c index 3af7c1d15..192551dbd 100644 --- a/tests/refs/create.c +++ b/tests/refs/create.c @@ -32,7 +32,7 @@ void test_refs_create__symbolic(void) git_oid_fromstr(&id, current_master_tip); /* Create and write the new symbolic reference */ - cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL)); /* Ensure the reference can be looked-up... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head_tracker)); @@ -73,7 +73,7 @@ void test_refs_create__deep_symbolic(void) git_oid_fromstr(&id, current_master_tip); - cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL)); cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head_tracker)); cl_git_pass(git_reference_resolve(&resolved_ref, looked_up_ref)); cl_assert_equal_oid(&id, git_reference_target(resolved_ref)); @@ -95,7 +95,7 @@ void test_refs_create__oid(void) git_oid_fromstr(&id, current_master_tip); /* Create and write the new object id reference */ - cl_git_pass(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL)); /* Ensure the reference can be looked-up... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head)); @@ -130,7 +130,7 @@ void test_refs_create__oid_unknown(void) git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644"); /* Create and write the new object id reference */ - cl_git_fail(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL, NULL)); + cl_git_fail(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL)); /* Ensure the reference can't be looked-up... */ cl_git_fail(git_reference_lookup(&looked_up_ref, g_repo, new_head)); @@ -144,10 +144,10 @@ void test_refs_create__propagate_eexists(void) /* Make sure it works for oid and for symbolic both */ git_oid_fromstr(&oid, current_master_tip); - error = git_reference_create(&ref, g_repo, current_head_target, &oid, false, NULL, NULL); + error = git_reference_create(&ref, g_repo, current_head_target, &oid, false, NULL); cl_assert(error == GIT_EEXISTS); - error = git_reference_symbolic_create(&ref, g_repo, "HEAD", current_head_target, false, NULL, NULL); + error = git_reference_symbolic_create(&ref, g_repo, "HEAD", current_head_target, false, NULL); cl_assert(error == GIT_EEXISTS); } @@ -159,10 +159,10 @@ static void test_invalid_name(const char *name) git_oid_fromstr(&id, current_master_tip); cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_create( - &new_reference, g_repo, name, &id, 0, NULL, NULL)); + &new_reference, g_repo, name, &id, 0, NULL)); cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_symbolic_create( - &new_reference, g_repo, name, current_head_target, 0, NULL, NULL)); + &new_reference, g_repo, name, current_head_target, 0, NULL)); } void test_refs_create__creating_a_reference_with_an_invalid_name_returns_EINVALIDSPEC(void) @@ -188,7 +188,7 @@ static void test_win32_name(const char *name) git_oid_fromstr(&id, current_master_tip); - ret = git_reference_create(&new_reference, g_repo, name, &id, 0, NULL, NULL); + ret = git_reference_create(&new_reference, g_repo, name, &id, 0, NULL); #ifdef GIT_WIN32 cl_assert_equal_i(GIT_EINVALIDSPEC, ret); diff --git a/tests/refs/createwithlog.c b/tests/refs/createwithlog.c index ab13d7d15..4f643635b 100644 --- a/tests/refs/createwithlog.c +++ b/tests/refs/createwithlog.c @@ -23,7 +23,6 @@ void test_refs_createwithlog__creating_a_direct_reference_adds_a_reflog_entry(vo { git_reference *reference; git_oid id; - git_signature *signature; git_reflog *reflog; const git_reflog_entry *entry; @@ -32,10 +31,8 @@ void test_refs_createwithlog__creating_a_direct_reference_adds_a_reflog_entry(vo git_oid_fromstr(&id, current_master_tip); - cl_git_pass(git_signature_now(&signature, "foo", "foo@bar")); - cl_git_pass( - git_reference_create(&reference, g_repo, name, &id, 0, signature, message)); + git_reference_create(&reference, g_repo, name, &id, 0, message)); cl_git_pass(git_reflog_read(&reflog, g_repo, name)); cl_assert_equal_sz(1, git_reflog_entrycount(reflog)); @@ -47,5 +44,4 @@ void test_refs_createwithlog__creating_a_direct_reference_adds_a_reflog_entry(vo git_reflog_free(reflog); git_reference_free(reference); - git_signature_free(signature); } diff --git a/tests/refs/delete.c b/tests/refs/delete.c index 9d1c3fd79..a1b9e251e 100644 --- a/tests/refs/delete.c +++ b/tests/refs/delete.c @@ -66,7 +66,7 @@ void test_refs_delete__packed_only(void) git_oid_fromstr(&id, current_master_tip); /* Create and write the new object id reference */ - cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &id, 0, NULL)); git_reference_free(ref); /* Lookup the reference */ diff --git a/tests/refs/foreachglob.c b/tests/refs/foreachglob.c index b992b07b8..a09191e79 100644 --- a/tests/refs/foreachglob.c +++ b/tests/refs/foreachglob.c @@ -12,7 +12,7 @@ void test_refs_foreachglob__initialize(void) cl_git_pass(git_repository_open(&repo, "testrepo.git")); cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); - cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL)); } void test_refs_foreachglob__cleanup(void) diff --git a/tests/refs/overwrite.c b/tests/refs/overwrite.c index c237d76f4..5aea2a764 100644 --- a/tests/refs/overwrite.c +++ b/tests/refs/overwrite.c @@ -27,8 +27,8 @@ void test_refs_overwrite__symbolic(void) git_reference *ref, *branch_ref; /* The target needds to exist and we need to check the name has changed */ - cl_git_pass(git_reference_symbolic_create(&branch_ref, g_repo, ref_branch_name, ref_master_name, 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_branch_name, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&branch_ref, g_repo, ref_branch_name, ref_master_name, 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_branch_name, 0, NULL)); git_reference_free(ref); /* Ensure it points to the right place*/ @@ -38,8 +38,8 @@ void test_refs_overwrite__symbolic(void) git_reference_free(ref); /* Ensure we can't create it unless we force it to */ - cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL, NULL)); + cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL)); git_reference_free(ref); /* Ensure it points to the right place */ @@ -63,7 +63,7 @@ void test_refs_overwrite__object_id(void) git_reference_free(ref); /* Create it */ - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); git_reference_free(ref); cl_git_pass(git_reference_lookup(&ref, g_repo, ref_test_name)); @@ -72,8 +72,8 @@ void test_refs_overwrite__object_id(void) git_reference_free(ref); /* Ensure we can't overwrite unless we force it */ - cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL, NULL)); + cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL)); git_reference_free(ref); /* Ensure it has been overwritten */ @@ -94,10 +94,10 @@ void test_refs_overwrite__object_id_with_symbolic(void) git_oid_cpy(&id, git_reference_target(ref)); git_reference_free(ref); - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); git_reference_free(ref); - cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL, NULL)); + cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL)); git_reference_free(ref); /* Ensure it points to the right place */ @@ -120,11 +120,11 @@ void test_refs_overwrite__symbolic_with_object_id(void) git_reference_free(ref); /* Create the symbolic ref */ - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); git_reference_free(ref); /* It shouldn't overwrite unless we tell it to */ - cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL, NULL)); + cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL)); git_reference_free(ref); /* Ensure it points to the right place */ diff --git a/tests/refs/pack.c b/tests/refs/pack.c index dbe377d7f..7dfaf6d8f 100644 --- a/tests/refs/pack.c +++ b/tests/refs/pack.c @@ -93,11 +93,11 @@ void test_refs_pack__symbolic(void) for (i = 0; i < 100; ++i) { p_snprintf(name, sizeof(name), "refs/heads/symbolic-%03d", i); cl_git_pass(git_reference_symbolic_create( - &ref, g_repo, name, "refs/heads/master", 0, NULL, NULL)); + &ref, g_repo, name, "refs/heads/master", 0, NULL)); git_reference_free(ref); p_snprintf(name, sizeof(name), "refs/heads/direct-%03d", i); - cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL)); git_reference_free(ref); } diff --git a/tests/refs/races.c b/tests/refs/races.c index 643290a8e..fbecf4a75 100644 --- a/tests/refs/races.c +++ b/tests/refs/races.c @@ -30,11 +30,11 @@ void test_refs_races__create_matching(void) git_oid_fromstr(&id, commit_id); git_oid_fromstr(&other_id, other_commit_id); - cl_git_fail_with(GIT_EMODIFIED, git_reference_create_matching(&ref, g_repo, refname, &other_id, 1, &other_id, NULL, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_create_matching(&ref, g_repo, refname, &other_id, 1, &other_id, NULL)); cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL, NULL)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL, NULL)); + cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -49,11 +49,11 @@ void test_refs_races__symbolic_create_matching(void) git_oid_fromstr(&id, commit_id); git_oid_fromstr(&other_id, other_commit_id); - cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_create_matching(&ref, g_repo, "HEAD", other_refname, 1, other_refname, NULL, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_create_matching(&ref, g_repo, "HEAD", other_refname, 1, other_refname, NULL)); cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, NULL, refname)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, refname)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -75,18 +75,18 @@ void test_refs_races__delete(void) /* We cannot delete a symbolic value that doesn't match */ cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, NULL, refname)); + cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, refname)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); git_reference_free(ref2); - cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL)); git_reference_free(ref); /* We cannot delete an oid value that doesn't match */ cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL, NULL)); + cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); @@ -103,19 +103,19 @@ void test_refs_races__switch_oid_to_symbolic(void) /* Removing a direct ref when it's currently symbolic should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); git_reference_free(ref2); - cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL)); git_reference_free(ref); /* Updating a direct ref when it's currently symbolic should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL, NULL)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -132,19 +132,19 @@ void test_refs_races__switch_symbolic_to_oid(void) /* Removing a symbolic ref when it's currently direct should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); git_reference_free(ref2); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, "HEAD", refname, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, "HEAD", refname, 1, NULL)); git_reference_free(ref); /* Updating a symbolic ref when it's currently direct should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL, NULL)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL, NULL)); + cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL)); git_reference_free(ref); git_reference_free(ref2); diff --git a/tests/refs/reflog/reflog.c b/tests/refs/reflog/reflog.c index 792b0f05d..56ec422c3 100644 --- a/tests/refs/reflog/reflog.c +++ b/tests/refs/reflog/reflog.c @@ -82,7 +82,7 @@ void test_refs_reflog_reflog__append_then_read(void) /* Create a new branch pointing at the HEAD */ git_oid_fromstr(&oid, current_master_tip); - cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &oid, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &oid, 0, NULL)); git_reference_free(ref); cl_git_pass(git_signature_now(&committer, "foo", "foo@bar")); @@ -114,7 +114,7 @@ void test_refs_reflog_reflog__renaming_the_reference_moves_the_reflog(void) cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&moved_log_path))); cl_git_pass(git_reference_lookup(&master, g_repo, "refs/heads/master")); - cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL)); git_reference_free(master); cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&master_log_path))); @@ -165,7 +165,7 @@ void test_refs_reflog_reflog__cannot_write_a_moved_reflog(void) cl_git_pass(git_reflog_write(reflog)); - cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL)); git_reference_free(master); cl_git_fail(git_reflog_write(reflog)); @@ -189,11 +189,11 @@ void test_refs_reflog_reflog__write_only_std_locations(void) git_oid_fromstr(&id, current_master_tip); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/foo", &id, 1, NULL)); git_reference_free(ref); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL)); git_reference_free(ref); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/notes/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/notes/foo", &id, 1, NULL)); git_reference_free(ref); assert_has_reflog(true, "refs/heads/foo"); @@ -210,7 +210,7 @@ void test_refs_reflog_reflog__write_when_explicitly_active(void) git_oid_fromstr(&id, current_master_tip); git_reference_ensure_log(g_repo, "refs/tags/foo"); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL)); git_reference_free(ref); assert_has_reflog(true, "refs/tags/foo"); } @@ -228,7 +228,7 @@ void test_refs_reflog_reflog__append_to_HEAD_when_changing_current_branch(void) /* Move it back */ git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL)); git_reference_free(ref); cl_git_pass(git_reflog_read(&log, g_repo, "HEAD")); @@ -250,7 +250,7 @@ void test_refs_reflog_reflog__do_not_append_when_no_update(void) cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/master")); cl_git_pass(git_reference_create(&ref2, g_repo, "refs/heads/master", - git_reference_target(ref), 1, NULL, NULL)); + git_reference_target(ref), 1, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -280,7 +280,7 @@ static void assert_no_reflog_update(void) /* Move it back */ git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL)); git_reference_free(ref); cl_git_pass(git_reflog_read(&log, g_repo, "HEAD")); diff --git a/tests/refs/rename.c b/tests/refs/rename.c index c7901bd8b..6106e6c67 100644 --- a/tests/refs/rename.c +++ b/tests/refs/rename.c @@ -22,6 +22,7 @@ static git_repository *g_repo; void test_refs_rename__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); + cl_git_pass(git_repository_set_ident(g_repo, "me", "foo@example.com")); } void test_refs_rename__cleanup(void) @@ -49,7 +50,7 @@ void test_refs_rename__loose(void) cl_assert(reference_is_packed(looked_up_ref) == 0); /* Now that the reference is renamed... */ - cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, new_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, new_name, 0, NULL)); cl_assert_equal_s(new_ref->name, new_name); git_reference_free(looked_up_ref); @@ -91,7 +92,7 @@ void test_refs_rename__packed(void) cl_assert(reference_is_packed(looked_up_ref) != 0); /* Now that the reference is renamed... */ - cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, brand_new_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, brand_new_name, 0, NULL)); cl_assert_equal_s(new_ref->name, brand_new_name); git_reference_free(looked_up_ref); @@ -140,7 +141,7 @@ void test_refs_rename__packed_doesnt_pack_others(void) cl_assert(reference_is_packed(looked_up_ref) != 0); /* Now that the reference is renamed... */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, brand_new_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, brand_new_name, 0, NULL)); git_reference_free(looked_up_ref); /* Lookup the other reference */ @@ -166,7 +167,7 @@ void test_refs_rename__name_collision(void) cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, packed_head_name)); /* Can not be renamed to the name of another existing reference. */ - cl_git_fail(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 0, NULL, NULL)); + cl_git_fail(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 0, NULL)); git_reference_free(looked_up_ref); /* Failure to rename it hasn't corrupted its state */ @@ -187,12 +188,12 @@ void test_refs_rename__invalid_name(void) /* Can not be renamed with an invalid name. */ cl_assert_equal_i( GIT_EINVALIDSPEC, - git_reference_rename(&renamed_ref, looked_up_ref, "Hello! I'm a very invalid name.", 0, NULL, NULL)); + git_reference_rename(&renamed_ref, looked_up_ref, "Hello! I'm a very invalid name.", 0, NULL)); /* Can not be renamed outside of the refs hierarchy * unless it's ALL_CAPS_AND_UNDERSCORES. */ - cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_rename(&renamed_ref, looked_up_ref, "i-will-sudo-you", 0, NULL, NULL)); + cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_rename(&renamed_ref, looked_up_ref, "i-will-sudo-you", 0, NULL)); /* Failure to rename it hasn't corrupted its state */ git_reference_free(looked_up_ref); @@ -213,7 +214,7 @@ void test_refs_rename__force_loose_packed(void) git_oid_cpy(&oid, git_reference_target(looked_up_ref)); /* Can be force-renamed to the name of another existing reference. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 1, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 1, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -238,7 +239,7 @@ void test_refs_rename__force_loose(void) git_oid_cpy(&oid, git_reference_target(looked_up_ref)); /* Can be force-renamed to the name of another existing reference. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, "refs/heads/test", 1, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, "refs/heads/test", 1, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -268,15 +269,15 @@ void test_refs_rename__overwrite(void) git_oid_cpy(&id, git_reference_target(ref)); /* Create loose references */ - cl_git_pass(git_reference_create(&ref_one, g_repo, ref_one_name, &id, 0, NULL, NULL)); - cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref_one, g_repo, ref_one_name, &id, 0, NULL)); + cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL)); /* Pack everything */ cl_git_pass(git_repository_refdb(&refdb, g_repo)); cl_git_pass(git_refdb_compress(refdb)); /* Attempt to create illegal reference */ - cl_git_fail(git_reference_create(&ref_one_new, g_repo, ref_one_name_new, &id, 0, NULL, NULL)); + cl_git_fail(git_reference_create(&ref_one_new, g_repo, ref_one_name_new, &id, 0, NULL)); /* Illegal reference couldn't be created so this is supposed to fail */ cl_git_fail(git_reference_lookup(&ref_one_new, g_repo, ref_one_name_new)); @@ -301,13 +302,13 @@ void test_refs_rename__prefix(void) git_oid_cpy(&id, git_reference_target(ref)); /* Create loose references */ - cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL)); /* An existing reference... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, ref_two_name)); /* Can be rename to a new name starting with the old name. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name_new, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name_new, 0, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -334,14 +335,14 @@ void test_refs_rename__move_up(void) git_oid_cpy(&id, git_reference_target(ref)); /* Create loose references */ - cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name_new, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name_new, &id, 0, NULL)); git_reference_free(ref_two); /* An existing reference... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, ref_two_name_new)); /* Can be renamed upward the reference tree. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name, 0, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -361,7 +362,7 @@ void test_refs_rename__propagate_eexists(void) cl_git_pass(git_reference_lookup(&ref, g_repo, packed_head_name)); - cl_assert_equal_i(GIT_EEXISTS, git_reference_rename(&new_ref, ref, packed_test_head_name, 0, NULL, NULL)); + cl_assert_equal_i(GIT_EEXISTS, git_reference_rename(&new_ref, ref, packed_test_head_name, 0, NULL)); git_reference_free(ref); } @@ -371,13 +372,10 @@ void test_refs_rename__writes_to_reflog(void) git_reference *ref, *new_ref; git_reflog *log; const git_reflog_entry *entry; - git_signature *sig; - - cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); cl_git_pass(git_reference_lookup(&ref, g_repo, ref_master_name)); cl_git_pass(git_reference_rename(&new_ref, ref, ref_one_name_new, false, - sig, "message")); + "message")); cl_git_pass(git_reflog_read(&log, g_repo, git_reference_name(new_ref))); entry = git_reflog_entry_byindex(log, 0); cl_assert_equal_s("message", git_reflog_entry_message(entry)); @@ -386,5 +384,4 @@ void test_refs_rename__writes_to_reflog(void) git_reflog_free(log); git_reference_free(ref); git_reference_free(new_ref); - git_signature_free(sig); } diff --git a/tests/refs/revparse.c b/tests/refs/revparse.c index 94e55bda4..ad468bbbe 100644 --- a/tests/refs/revparse.c +++ b/tests/refs/revparse.c @@ -325,7 +325,7 @@ static void create_fake_stash_reference_and_reflog(git_repository *repo) cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&log_path))); cl_git_pass(git_reference_lookup(&master, repo, "refs/heads/master")); - cl_git_pass(git_reference_rename(&new_master, master, "refs/fakestash", 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_master, master, "refs/fakestash", 0, NULL)); git_reference_free(master); cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&log_path))); @@ -597,7 +597,7 @@ void test_refs_revparse__issue_994(void) "refs/remotes/origin/bim_with_3d@11296", git_reference_target(head), 0, - NULL, NULL)); + NULL)); cl_git_pass(git_revparse_single(&target, repo, "origin/bim_with_3d@11296")); git_object_free(target); @@ -634,7 +634,7 @@ void test_refs_revparse__try_to_retrieve_branch_before_described_tag(void) test_object_inrepo("blah-7-gc47800c", "c47800c7266a2be04c571c04d5a6614691ea99bd", repo); cl_git_pass(git_revparse_single(&target, repo, "HEAD~3")); - cl_git_pass(git_branch_create(&branch, repo, "blah-7-gc47800c", (git_commit *)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "blah-7-gc47800c", (git_commit *)target, 0, NULL)); git_oid_tostr(sha, GIT_OID_HEXSZ + 1, git_object_id(target)); @@ -672,7 +672,7 @@ void test_refs_revparse__try_to_retrieve_sha_before_branch(void) test_object_inrepo("a65fedf39aefe402d3bb6e24df4d4f5fe4547750", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", repo); cl_git_pass(git_revparse_single(&target, repo, "HEAD~3")); - cl_git_pass(git_branch_create(&branch, repo, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", (git_commit *)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", (git_commit *)target, 0, NULL)); git_oid_tostr(sha, GIT_OID_HEXSZ + 1, git_object_id(target)); @@ -708,7 +708,7 @@ void test_refs_revparse__try_to_retrieve_branch_before_abbrev_sha(void) test_object_inrepo("c47800", "c47800c7266a2be04c571c04d5a6614691ea99bd", repo); cl_git_pass(git_revparse_single(&target, repo, "HEAD~3")); - cl_git_pass(git_branch_create(&branch, repo, "c47800", (git_commit *)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "c47800", (git_commit *)target, 0, NULL)); git_oid_tostr(sha, GIT_OID_HEXSZ + 1, git_object_id(target)); diff --git a/tests/refs/settargetwithlog.c b/tests/refs/settargetwithlog.c index 3a3378186..58fbb5fee 100644 --- a/tests/refs/settargetwithlog.c +++ b/tests/refs/settargetwithlog.c @@ -25,7 +25,6 @@ void test_refs_settargetwithlog__updating_a_direct_reference_adds_a_reflog_entry { git_reference *reference, *reference_out; git_oid current_id, target_id; - git_signature *signature; git_reflog *reflog; const git_reflog_entry *entry; @@ -36,10 +35,8 @@ void test_refs_settargetwithlog__updating_a_direct_reference_adds_a_reflog_entry cl_git_pass(git_reference_lookup(&reference, g_repo, br2_name)); - cl_git_pass(git_signature_now(&signature, "foo", "foo@bar")); - cl_git_pass(git_reference_set_target( - &reference_out, reference, &target_id, signature, message)); + &reference_out, reference, &target_id, message)); cl_git_pass(git_reflog_read(&reflog, g_repo, br2_name)); @@ -51,5 +48,4 @@ void test_refs_settargetwithlog__updating_a_direct_reference_adds_a_reflog_entry git_reflog_free(reflog); git_reference_free(reference_out); git_reference_free(reference); - git_signature_free(signature); } diff --git a/tests/refs/setter.c b/tests/refs/setter.c index a5d073a56..2b42ff253 100644 --- a/tests/refs/setter.c +++ b/tests/refs/setter.c @@ -34,7 +34,7 @@ void test_refs_setter__update_direct(void) cl_git_pass(git_reference_lookup(&test_ref, g_repo, ref_test_name)); cl_assert(git_reference_type(test_ref) == GIT_REF_OID); - cl_git_pass(git_reference_set_target(&new_ref, test_ref, &id, NULL, NULL)); + cl_git_pass(git_reference_set_target(&new_ref, test_ref, &id, NULL)); git_reference_free(test_ref); git_reference_free(new_ref); @@ -53,7 +53,7 @@ void test_refs_setter__update_symbolic(void) cl_assert(git_reference_type(head) == GIT_REF_SYMBOLIC); cl_assert(strcmp(git_reference_symbolic_target(head), ref_master_name) == 0); - cl_git_pass(git_reference_symbolic_set_target(&new_head, head, ref_test_name, NULL, NULL)); + cl_git_pass(git_reference_symbolic_set_target(&new_head, head, ref_test_name, NULL)); git_reference_free(new_head); git_reference_free(head); @@ -73,7 +73,7 @@ void test_refs_setter__cant_update_direct_with_symbolic(void) cl_assert(git_reference_type(ref) == GIT_REF_OID); git_oid_cpy(&id, git_reference_target(ref)); - cl_git_fail(git_reference_symbolic_set_target(&new, ref, ref_name, NULL, NULL)); + cl_git_fail(git_reference_symbolic_set_target(&new, ref, ref_name, NULL)); git_reference_free(ref); } @@ -90,10 +90,10 @@ void test_refs_setter__cant_update_symbolic_with_direct(void) git_reference_free(ref); /* Create the symbolic ref */ - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); /* Can't set an OID on a direct ref */ - cl_git_fail(git_reference_set_target(&new, ref, &id, NULL, NULL)); + cl_git_fail(git_reference_set_target(&new, ref, &id, NULL)); git_reference_free(ref); } diff --git a/tests/refs/unicode.c b/tests/refs/unicode.c index 9c7527cd7..a279d5006 100644 --- a/tests/refs/unicode.c +++ b/tests/refs/unicode.c @@ -24,7 +24,7 @@ void test_refs_unicode__create_and_lookup(void) /* Create the reference */ cl_git_pass(git_reference_lookup(&ref0, repo, master)); cl_git_pass(git_reference_create( - &ref1, repo, REFNAME, git_reference_target(ref0), 0, NULL, NULL)); + &ref1, repo, REFNAME, git_reference_target(ref0), 0, NULL)); cl_assert_equal_s(REFNAME, git_reference_name(ref1)); git_reference_free(ref0); diff --git a/tests/refs/update.c b/tests/refs/update.c index 873fc4ebe..403ea75b8 100644 --- a/tests/refs/update.c +++ b/tests/refs/update.c @@ -22,5 +22,5 @@ void test_refs_update__updating_the_target_of_a_symref_with_an_invalid_name_retu cl_assert_equal_i(GIT_REF_SYMBOLIC, git_reference_type(head)); git_reference_free(head); - cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_symbolic_create(&head, g_repo, GIT_HEAD_FILE, "refs/heads/inv@{id", 1, NULL, NULL)); + cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_symbolic_create(&head, g_repo, GIT_HEAD_FILE, "refs/heads/inv@{id", 1, NULL)); } |