diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-12-23 15:07:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-23 15:07:29 -0500 |
| commit | a50bbba18946cc7c457dc2ee376cf12b42a9b900 (patch) | |
| tree | 0c6632c659f94eed88d639e2bd5c90d952c01a5f /src | |
| parent | 05c3d972be68c33fdd397d4b2cf6f090d4b3f994 (diff) | |
| parent | 4591e76a2d1aa07dc80eaa002b4ed7c58d81c242 (diff) | |
| download | libgit2-a50bbba18946cc7c457dc2ee376cf12b42a9b900.tar.gz | |
Merge pull request #6142 from libgit2/ethomson/blob_data_is_binary
blob: identify binary content
Diffstat (limited to 'src')
| -rw-r--r-- | src/blob.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c index 65841ab03..19ce8b3b5 100644 --- a/src/blob.c +++ b/src/blob.c @@ -404,6 +404,15 @@ int git_blob_is_binary(const git_blob *blob) return git_str_is_binary(&content); } +int git_blob_data_is_binary(const char *str, size_t len) +{ + git_str content = GIT_STR_INIT; + + git_str_attach_notowned(&content, str, len); + + return git_str_is_binary(&content); +} + int git_blob_filter_options_init( git_blob_filter_options *opts, unsigned int version) |
