summaryrefslogtreecommitdiff
path: root/include/git2/oid.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/oid.h')
-rw-r--r--include/git2/oid.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 06bbfcc55..46d0dce0d 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -65,6 +65,19 @@ typedef struct {
GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str);
/**
+ * Parse N characters of a hex formatted object id into a git_oid
+ *
+ * If N is odd, N-1 characters will be parsed instead.
+ * The remaining space in the git_oid will be set to zero.
+ *
+ * @param out oid structure the result is written into.
+ * @param str input hex string of at least size `length`
+ * @param length length of the input string
+ * @return GIT_SUCCESS if valid; GIT_ENOTOID on failure.
+ */
+GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length);
+
+/**
* Copy an already raw oid into a git_oid structure.
*
* @param out oid structure the result is written into.