diff options
Diffstat (limited to 'include/git2/blob.h')
-rw-r--r-- | include/git2/blob.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h index 8fc73919d..6db85f38d 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -119,7 +119,7 @@ typedef enum { * When set, filters will be loaded from a `.gitattributes` file * in the specified commit. */ - GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT = (1 << 3), + GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT = (1 << 3) } git_blob_filter_flag_t; /** @@ -285,11 +285,24 @@ GIT_EXTERN(int) git_blob_create_from_buffer( GIT_EXTERN(int) git_blob_is_binary(const git_blob *blob); /** + * Determine if the given content is most certainly binary or not; + * this is the same mechanism used by `git_blob_is_binary` but only + * looking at raw data. + * + * @param data The blob data which content should be analyzed + * @param len The length of the data + * @return 1 if the content of the blob is detected + * as binary; 0 otherwise. + */ +GIT_EXTERN(int) git_blob_data_is_binary(const char *data, size_t len); + +/** * Create an in-memory copy of a blob. The copy must be explicitly * free'd or it will leak. * * @param out Pointer to store the copy of the object * @param source Original object to copy + * @return 0. */ GIT_EXTERN(int) git_blob_dup(git_blob **out, git_blob *source); |