diff options
Diffstat (limited to 'tests/refs/peel.c')
-rw-r--r-- | tests/refs/peel.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/tests/refs/peel.c b/tests/refs/peel.c index 09809e19e..38f3465a0 100644 --- a/tests/refs/peel.c +++ b/tests/refs/peel.c @@ -20,16 +20,16 @@ void test_refs_peel__cleanup(void) static void assert_peel_generic( git_repository *repo, const char *ref_name, - git_otype requested_type, + git_object_t requested_type, const char* expected_sha, - git_otype expected_type) + git_object_t expected_type) { git_oid expected_oid; git_reference *ref; git_object *peeled; cl_git_pass(git_reference_lookup(&ref, repo, ref_name)); - + cl_git_pass(git_reference_peel(&peeled, ref, requested_type)); cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha)); @@ -43,21 +43,21 @@ static void assert_peel_generic( static void assert_peel( const char *ref_name, - git_otype requested_type, + git_object_t requested_type, const char* expected_sha, - git_otype expected_type) + git_object_t expected_type) { assert_peel_generic(g_repo, ref_name, requested_type, expected_sha, expected_type); } -static void assert_peel_error(int error, const char *ref_name, git_otype requested_type) +static void assert_peel_error(int error, const char *ref_name, git_object_t requested_type) { git_reference *ref; git_object *peeled; cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name)); - + cl_assert_equal_i(error, git_reference_peel(&peeled, ref, requested_type)); git_reference_free(ref); @@ -65,67 +65,67 @@ static void assert_peel_error(int error, const char *ref_name, git_otype request void test_refs_peel__can_peel_a_tag(void) { - assert_peel("refs/tags/test", GIT_OBJ_TAG, - "b25fa35b38051e4ae45d4222e795f9df2e43f1d1", GIT_OBJ_TAG); - assert_peel("refs/tags/test", GIT_OBJ_COMMIT, - "e90810b8df3e80c413d903f631643c716887138d", GIT_OBJ_COMMIT); - assert_peel("refs/tags/test", GIT_OBJ_TREE, - "53fc32d17276939fc79ed05badaef2db09990016", GIT_OBJ_TREE); - assert_peel("refs/tags/point_to_blob", GIT_OBJ_BLOB, - "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OBJ_BLOB); + assert_peel("refs/tags/test", GIT_OBJECT_TAG, + "b25fa35b38051e4ae45d4222e795f9df2e43f1d1", GIT_OBJECT_TAG); + assert_peel("refs/tags/test", GIT_OBJECT_COMMIT, + "e90810b8df3e80c413d903f631643c716887138d", GIT_OBJECT_COMMIT); + assert_peel("refs/tags/test", GIT_OBJECT_TREE, + "53fc32d17276939fc79ed05badaef2db09990016", GIT_OBJECT_TREE); + assert_peel("refs/tags/point_to_blob", GIT_OBJECT_BLOB, + "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OBJECT_BLOB); } void test_refs_peel__can_peel_a_branch(void) { - assert_peel("refs/heads/master", GIT_OBJ_COMMIT, - "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OBJ_COMMIT); - assert_peel("refs/heads/master", GIT_OBJ_TREE, - "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162", GIT_OBJ_TREE); + assert_peel("refs/heads/master", GIT_OBJECT_COMMIT, + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OBJECT_COMMIT); + assert_peel("refs/heads/master", GIT_OBJECT_TREE, + "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162", GIT_OBJECT_TREE); } void test_refs_peel__can_peel_a_symbolic_reference(void) { - assert_peel("HEAD", GIT_OBJ_COMMIT, - "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OBJ_COMMIT); - assert_peel("HEAD", GIT_OBJ_TREE, - "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162", GIT_OBJ_TREE); + assert_peel("HEAD", GIT_OBJECT_COMMIT, + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OBJECT_COMMIT); + assert_peel("HEAD", GIT_OBJECT_TREE, + "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162", GIT_OBJECT_TREE); } void test_refs_peel__cannot_peel_into_a_non_existing_target(void) { - assert_peel_error(GIT_EINVALIDSPEC, "refs/tags/point_to_blob", GIT_OBJ_TAG); + assert_peel_error(GIT_EINVALIDSPEC, "refs/tags/point_to_blob", GIT_OBJECT_TAG); } void test_refs_peel__can_peel_into_any_non_tag_object(void) { - assert_peel("refs/heads/master", GIT_OBJ_ANY, - "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OBJ_COMMIT); - assert_peel("refs/tags/point_to_blob", GIT_OBJ_ANY, - "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OBJ_BLOB); - assert_peel("refs/tags/test", GIT_OBJ_ANY, - "e90810b8df3e80c413d903f631643c716887138d", GIT_OBJ_COMMIT); + assert_peel("refs/heads/master", GIT_OBJECT_ANY, + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OBJECT_COMMIT); + assert_peel("refs/tags/point_to_blob", GIT_OBJECT_ANY, + "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OBJECT_BLOB); + assert_peel("refs/tags/test", GIT_OBJECT_ANY, + "e90810b8df3e80c413d903f631643c716887138d", GIT_OBJECT_COMMIT); } void test_refs_peel__can_peel_fully_peeled_packed_refs(void) { assert_peel_generic(g_peel_repo, - "refs/tags/tag-inside-tags", GIT_OBJ_ANY, + "refs/tags/tag-inside-tags", GIT_OBJECT_ANY, "0df1a5865c8abfc09f1f2182e6a31be550e99f07", - GIT_OBJ_COMMIT); + GIT_OBJECT_COMMIT); assert_peel_generic(g_peel_repo, - "refs/foo/tag-outside-tags", GIT_OBJ_ANY, + "refs/foo/tag-outside-tags", GIT_OBJECT_ANY, "0df1a5865c8abfc09f1f2182e6a31be550e99f07", - GIT_OBJ_COMMIT); + GIT_OBJECT_COMMIT); } void test_refs_peel__can_peel_fully_peeled_tag_to_tag(void) { assert_peel_generic(g_peel_repo, - "refs/tags/tag-inside-tags", GIT_OBJ_TAG, + "refs/tags/tag-inside-tags", GIT_OBJECT_TAG, "c2596aa0151888587ec5c0187f261e63412d9e11", - GIT_OBJ_TAG); + GIT_OBJECT_TAG); assert_peel_generic(g_peel_repo, - "refs/foo/tag-outside-tags", GIT_OBJ_TAG, + "refs/foo/tag-outside-tags", GIT_OBJECT_TAG, "c2596aa0151888587ec5c0187f261e63412d9e11", - GIT_OBJ_TAG); + GIT_OBJECT_TAG); } |