summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/object.c b/src/object.c
index 2e45eb86a..4b3c0f41a 100644
--- a/src/object.c
+++ b/src/object.c
@@ -413,3 +413,16 @@ int git_object_peel(
git_object_free(deref);
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;
+}