diff options
author | Philip Kelley <phkelley@hotmail.com> | 2012-11-28 11:42:37 -0500 |
---|---|---|
committer | Philip Kelley <phkelley@hotmail.com> | 2012-11-28 11:42:37 -0500 |
commit | 613d5eb9391d6cc33c91f4dc9cdb5ede1885dc72 (patch) | |
tree | bd94a2a5ea154a3849114575368b7531f0d45024 /src/object.c | |
parent | 693021262ba0eeac2923bbce1b2262717019c807 (diff) | |
download | libgit2-613d5eb9391d6cc33c91f4dc9cdb5ede1885dc72.tar.gz |
Push! By schu, phkelley, and congyiwu, et al
Diffstat (limited to 'src/object.c')
-rw-r--r-- | src/object.c | 16 |
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; +} |