summaryrefslogtreecommitdiff
path: root/include/git2/oid.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-09-30 04:38:05 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-09-30 04:38:05 +0200
commitaf6cc38fc0acba14277ebfd247e0a46a867a2c33 (patch)
treedef8c9608166385421ca769972b93258e1066db8 /include/git2/oid.h
parent3a728fb508ea3eea8033a9e338c61a6421ad21b2 (diff)
parenta2a23322193eeca5d2912c0b74c5374f8ec21737 (diff)
downloadlibgit2-af6cc38fc0acba14277ebfd247e0a46a867a2c33.tar.gz
Merge remote-tracking branch 'upstream/master' into cmn/describe
Diffstat (limited to 'include/git2/oid.h')
-rw-r--r--include/git2/oid.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 1cfd4e5e2..db2f3af70 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -116,13 +116,17 @@ GIT_EXTERN(void) git_oid_nfmt(char *out, size_t n, const git_oid *id);
GIT_EXTERN(void) git_oid_pathfmt(char *out, const git_oid *id);
/**
- * Format a git_oid into a newly allocated c-string.
+ * Format a git_oid into a statically allocated c-string.
+ *
+ * The c-string is owned by the library and should not be freed
+ * by the user. If libgit2 is built with thread support, the string
+ * will be stored in TLS (i.e. one buffer per thread) to allow for
+ * concurrent calls of the function.
*
* @param id the oid structure to format
- * @return the c-string; NULL if memory is exhausted. Caller must
- * deallocate the string with git__free().
+ * @return the c-string
*/
-GIT_EXTERN(char *) git_oid_allocfmt(const git_oid *id);
+GIT_EXTERN(char *) git_oid_tostr_s(const git_oid *oid);
/**
* Format a git_oid into a buffer as a hex format c-string.