summaryrefslogtreecommitdiff
path: root/include/git2/object.h
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-03-06 00:47:05 +0100
committerVicent Marti <vicent@github.com>2014-03-06 00:47:05 +0100
commita064dc2d0b6206116a35be4b62c58c3c1170d5de (patch)
treeca3a9de862d9ec7042d5446a302cb8cf924618e1 /include/git2/object.h
parenta62ad3c353380fb95d0f482859b445d430018aa9 (diff)
parent26875825df19d484c24921e355963e75dc0a4476 (diff)
downloadlibgit2-a064dc2d0b6206116a35be4b62c58c3c1170d5de.tar.gz
Merge pull request #2159 from libgit2/rb/odb-exists-prefix
Add ODB API to check for existence by prefix and object id shortener
Diffstat (limited to 'include/git2/object.h')
-rw-r--r--include/git2/object.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/object.h b/include/git2/object.h
index c40631fa6..416feffbc 100644
--- a/include/git2/object.h
+++ b/include/git2/object.h
@@ -10,6 +10,7 @@
#include "common.h"
#include "types.h"
#include "oid.h"
+#include "buffer.h"
/**
* @file git2/object.h
@@ -104,6 +105,15 @@ GIT_EXTERN(int) git_object_lookup_bypath(
GIT_EXTERN(const git_oid *) git_object_id(const git_object *obj);
/**
+ * Get a short abbreviated OID string for the object
+ *
+ * @param out Buffer to write string into
+ * @param obj The object to get an ID for
+ * @return 0 on success, <0 for error
+ */
+GIT_EXTERN(int) git_object_short_id(git_buf *out, const git_object *obj);
+
+/**
* Get the object type of an object
*
* @param obj the repository object