summaryrefslogtreecommitdiff
path: root/include/git2/blob.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-12-23 15:07:29 -0500
committerGitHub <noreply@github.com>2021-12-23 15:07:29 -0500
commita50bbba18946cc7c457dc2ee376cf12b42a9b900 (patch)
tree0c6632c659f94eed88d639e2bd5c90d952c01a5f /include/git2/blob.h
parent05c3d972be68c33fdd397d4b2cf6f090d4b3f994 (diff)
parent4591e76a2d1aa07dc80eaa002b4ed7c58d81c242 (diff)
downloadlibgit2-a50bbba18946cc7c457dc2ee376cf12b42a9b900.tar.gz
Merge pull request #6142 from libgit2/ethomson/blob_data_is_binary
blob: identify binary content
Diffstat (limited to 'include/git2/blob.h')
-rw-r--r--include/git2/blob.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h
index 4922b087a..59fac9e20 100644
--- a/include/git2/blob.h
+++ b/include/git2/blob.h
@@ -285,6 +285,18 @@ 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.
*