diff options
author | Vicent Martà <vicent@github.com> | 2013-03-25 13:26:50 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-03-25 13:26:50 -0700 |
commit | 1f10747854f04d0ff0e582682613a7cc8a3bcbc8 (patch) | |
tree | 1696a17843f179b04634ba9b38eef236e1e07e02 /include/git2 | |
parent | c2ea65eec31bc3c2c406a6ad60691916779b23f2 (diff) | |
parent | b3c174835b016a6fa8f23923beddd0d8fa68f19b (diff) | |
download | libgit2-1f10747854f04d0ff0e582682613a7cc8a3bcbc8.tar.gz |
Merge pull request #1428 from xavier-l/nul-terminated-oid
Nul terminated oid
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/oid.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/oid.h b/include/git2/oid.h index 6be02da6e..d2f3f4a14 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -47,6 +47,16 @@ typedef struct git_oid { GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str); /** + * Parse a hex formatted null-terminated string into a git_oid. + * + * @param out oid structure the result is written into. + * @param str input hex string; must be at least 4 characters + * long and null-terminated. + * @return 0 or an error code + */ +GIT_EXTERN(int) git_oid_fromstrp(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. |