diff options
Diffstat (limited to 'include/git2/object.h')
-rw-r--r-- | include/git2/object.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/include/git2/object.h b/include/git2/object.h index 5610a476f..6384aaa6e 100644 --- a/include/git2/object.h +++ b/include/git2/object.h @@ -225,6 +225,7 @@ GIT_EXTERN(int) git_object_peel( */ GIT_EXTERN(int) git_object_dup(git_object **dest, git_object *source); +#ifdef GIT_EXPERIMENTAL_SHA256 /** * Analyzes a buffer of raw object content and determines its validity. * Tree, commit, and tag objects will be parsed and ensured that they @@ -238,14 +239,39 @@ GIT_EXTERN(int) git_object_dup(git_object **dest, git_object *source); * @param valid Output pointer to set with validity of the object content * @param buf The contents to validate * @param len The length of the buffer - * @param type The type of the object in the buffer + * @param object_type The type of the object in the buffer + * @param oid_type The object ID type for the OIDs in the given buffer * @return 0 on success or an error code */ GIT_EXTERN(int) git_object_rawcontent_is_valid( int *valid, const char *buf, size_t len, - git_object_t type); + git_object_t object_type, + git_oid_t oid_type); +#else +/** + * Analyzes a buffer of raw object content and determines its validity. + * Tree, commit, and tag objects will be parsed and ensured that they + * are valid, parseable content. (Blobs are always valid by definition.) + * An error message will be set with an informative message if the object + * is not valid. + * + * @warning This function is experimental and its signature may change in + * the future. + * + * @param valid Output pointer to set with validity of the object content + * @param buf The contents to validate + * @param len The length of the buffer + * @param object_type The type of the object in the buffer + * @return 0 on success or an error code + */ +GIT_EXTERN(int) git_object_rawcontent_is_valid( + int *valid, + const char *buf, + size_t len, + git_object_t object_type); +#endif /** @} */ GIT_END_DECL |