summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kelley <phkelley@hotmail.com>2012-11-29 08:22:15 -0500
committerPhilip Kelley <phkelley@hotmail.com>2012-11-29 08:22:15 -0500
commitac22d08f2fbe53c28a0f7dffcfa44c5408dcf78f (patch)
tree95ebc791ee8b7ee0edc1223011db550a8b2e3d0f
parent613d5eb9391d6cc33c91f4dc9cdb5ede1885dc72 (diff)
downloadlibgit2-ac22d08f2fbe53c28a0f7dffcfa44c5408dcf78f.tar.gz
Remove git_object_oid2type
-rw-r--r--include/git2/object.h11
-rw-r--r--src/object.c15
-rw-r--r--tests-clar/object/lookup.c11
3 files changed, 0 insertions, 37 deletions
diff --git a/include/git2/object.h b/include/git2/object.h
index 66d692161..fcc56cb27 100644
--- a/include/git2/object.h
+++ b/include/git2/object.h
@@ -95,17 +95,6 @@ GIT_EXTERN(const git_oid *) git_object_id(const git_object *obj);
GIT_EXTERN(git_otype) git_object_type(const git_object *obj);
/**
- * Get the object type of an object id
- *
- * @param obj the repository object
- * @return the object's type
- */
-GIT_EXTERN(int) git_object_oid2type(
- git_otype *type,
- git_repository *repo,
- const git_oid *oid);
-
-/**
* Get the repository that owns this object
*
* Freeing or calling `git_repository_close` on the
diff --git a/src/object.c b/src/object.c
index 0666c4466..f88c2ba50 100644
--- a/src/object.c
+++ b/src/object.c
@@ -374,18 +374,3 @@ int git_object_peel(
return -1;
}
-int git_object_oid2type(
- git_otype *type,
- git_repository *repo,
- const git_oid *oid)
-{
- git_object *obj;
-
- if (git_object_lookup(&obj, repo, oid, GIT_OBJ_ANY) < 0)
- return -1;
-
- *type = git_object_type(obj);
-
- git_object_free(obj);
- return 0;
-}
diff --git a/tests-clar/object/lookup.c b/tests-clar/object/lookup.c
index 47efe88cb..cfa6d4678 100644
--- a/tests-clar/object/lookup.c
+++ b/tests-clar/object/lookup.c
@@ -63,14 +63,3 @@ void test_object_lookup__lookup_wrong_type_eventually_returns_enotfound(void)
GIT_ENOTFOUND, git_object_lookup(&object, g_repo, &oid, GIT_OBJ_TAG));
}
-void test_object_lookup__lookup_object_type_by_oid(void)
-{
- const char *commit = "e90810b8df3e80c413d903f631643c716887138d";
- git_oid oid;
- git_otype type;
-
- cl_git_pass(git_oid_fromstr(&oid, commit));
-
- cl_git_pass(git_object_oid2type(&type, g_repo, &oid));
- cl_assert(type == GIT_OBJ_COMMIT);
-}