Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/refs/overwrite.c')
-rw-r--r--tests-clar/refs/overwrite.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests-clar/refs/overwrite.c b/tests-clar/refs/overwrite.c
index 410e39a84..ebe72069c 100644
--- a/tests-clar/refs/overwrite.c
+++ b/tests-clar/refs/overwrite.c
@@ -27,25 +27,25 @@ 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_create_symbolic(&branch_ref, g_repo, ref_branch_name, ref_master_name, 0));
- cl_git_pass(git_reference_create_symbolic(&ref, g_repo, ref_name, ref_branch_name, 0));
+ cl_git_pass(git_reference_symbolic_create(&branch_ref, g_repo, ref_branch_name, ref_master_name, 0));
+ cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_branch_name, 0));
git_reference_free(ref);
/* Ensure it points to the right place*/
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name));
cl_assert(git_reference_type(ref) & GIT_REF_SYMBOLIC);
- cl_assert_equal_s(git_reference_target(ref), ref_branch_name);
+ cl_assert_equal_s(git_reference_symbolic_target(ref), ref_branch_name);
git_reference_free(ref);
/* Ensure we can't create it unless we force it to */
- cl_git_fail(git_reference_create_symbolic(&ref, g_repo, ref_name, ref_master_name, 0));
- cl_git_pass(git_reference_create_symbolic(&ref, g_repo, ref_name, ref_master_name, 1));
+ cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0));
+ cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1));
git_reference_free(ref);
/* Ensure it points to the right place */
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name));
cl_assert(git_reference_type(ref) & GIT_REF_SYMBOLIC);
- cl_assert_equal_s(git_reference_target(ref), ref_master_name);
+ cl_assert_equal_s(git_reference_symbolic_target(ref), ref_master_name);
git_reference_free(ref);
git_reference_free(branch_ref);
@@ -59,26 +59,26 @@ void test_refs_overwrite__object_id(void)
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_master_name));
cl_assert(git_reference_type(ref) & GIT_REF_OID);
- git_oid_cpy(&id, git_reference_oid(ref));
+ git_oid_cpy(&id, git_reference_target(ref));
git_reference_free(ref);
/* Create it */
- cl_git_pass(git_reference_create_oid(&ref, g_repo, ref_name, &id, 0));
+ cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0));
git_reference_free(ref);
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_test_name));
cl_assert(git_reference_type(ref) & GIT_REF_OID);
- git_oid_cpy(&id, git_reference_oid(ref));
+ git_oid_cpy(&id, git_reference_target(ref));
git_reference_free(ref);
/* Ensure we can't overwrite unless we force it */
- cl_git_fail(git_reference_create_oid(&ref, g_repo, ref_name, &id, 0));
- cl_git_pass(git_reference_create_oid(&ref, g_repo, ref_name, &id, 1));
+ cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0));
+ cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1));
git_reference_free(ref);
/* Ensure it has been overwritten */
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name));
- cl_assert(!git_oid_cmp(&id, git_reference_oid(ref)));
+ cl_assert(!git_oid_cmp(&id, git_reference_target(ref)));
git_reference_free(ref);
}
@@ -91,19 +91,19 @@ void test_refs_overwrite__object_id_with_symbolic(void)
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_master_name));
cl_assert(git_reference_type(ref) & GIT_REF_OID);
- git_oid_cpy(&id, git_reference_oid(ref));
+ git_oid_cpy(&id, git_reference_target(ref));
git_reference_free(ref);
- cl_git_pass(git_reference_create_oid(&ref, g_repo, ref_name, &id, 0));
+ cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0));
git_reference_free(ref);
- cl_git_fail(git_reference_create_symbolic(&ref, g_repo, ref_name, ref_master_name, 0));
- cl_git_pass(git_reference_create_symbolic(&ref, g_repo, ref_name, ref_master_name, 1));
+ cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0));
+ cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1));
git_reference_free(ref);
/* Ensure it points to the right place */
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name));
cl_assert(git_reference_type(ref) & GIT_REF_SYMBOLIC);
- cl_assert_equal_s(git_reference_target(ref), ref_master_name);
+ cl_assert_equal_s(git_reference_symbolic_target(ref), ref_master_name);
git_reference_free(ref);
}
@@ -116,21 +116,21 @@ void test_refs_overwrite__symbolic_with_object_id(void)
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_master_name));
cl_assert(git_reference_type(ref) & GIT_REF_OID);
- git_oid_cpy(&id, git_reference_oid(ref));
+ git_oid_cpy(&id, git_reference_target(ref));
git_reference_free(ref);
/* Create the symbolic ref */
- cl_git_pass(git_reference_create_symbolic(&ref, g_repo, ref_name, ref_master_name, 0));
+ cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0));
git_reference_free(ref);
/* It shouldn't overwrite unless we tell it to */
- cl_git_fail(git_reference_create_oid(&ref, g_repo, ref_name, &id, 0));
- cl_git_pass(git_reference_create_oid(&ref, g_repo, ref_name, &id, 1));
+ cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0));
+ cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1));
git_reference_free(ref);
/* Ensure it points to the right place */
cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name));
cl_assert(git_reference_type(ref) & GIT_REF_OID);
- cl_assert(!git_oid_cmp(git_reference_oid(ref), &id));
+ cl_assert(!git_oid_cmp(git_reference_target(ref), &id));
git_reference_free(ref);
}