summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/object.c b/src/object.c
index 392fd80a8..0666c4466 100644
--- a/src/object.c
+++ b/src/object.c
@@ -373,3 +373,19 @@ 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;
+}