diff options
| -rw-r--r-- | include/git2/blob.h | 19 | ||||
| -rw-r--r-- | include/git2/deprecated.h | 7 | ||||
| -rw-r--r-- | src/blob.c | 32 |
3 files changed, 23 insertions, 35 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h index be721edd0..3710f41bf 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -146,25 +146,6 @@ GIT_EXTERN(int) git_blob_filter( git_blob_filter_options *opts); /** - * Get a buffer with the filtered content of a blob. This is - * equivalent to calling `git_blob_filter`, with the only possible - * option being the binary check. - * - * @see git_blob_filter - * @param out The git_buf to be filled in - * @param blob Pointer to the blob - * @param as_path Path used for file attribute lookups, etc. - * @param check_for_binary_data Should this test if blob content contains - * NUL bytes / looks like binary data before applying filters? - * @return 0 on success or an error code - */ -GIT_EXTERN(int) git_blob_filtered_content( - git_buf *out, - git_blob *blob, - const char *as_path, - int check_for_binary_data); - -/** * Read a file from the working folder of a repository * and write it to the Object Database as a loose blob * diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h index fec56b18b..1abfd501f 100644 --- a/include/git2/deprecated.h +++ b/include/git2/deprecated.h @@ -90,6 +90,13 @@ GIT_EXTERN(int) git_blob_create_fromstream_commit( GIT_EXTERN(int) git_blob_create_frombuffer( git_oid *id, git_repository *repo, const void *buffer, size_t len); +/** Deprecated in favor of @see git_blob_filter */ +GIT_EXTERN(int) git_blob_filtered_content( + git_buf *out, + git_blob *blob, + const char *as_path, + int check_for_binary_data); + /**@}*/ /** @name Deprecated Buffer Functions diff --git a/src/blob.c b/src/blob.c index efc9fc884..1af3131ba 100644 --- a/src/blob.c +++ b/src/blob.c @@ -437,22 +437,6 @@ int git_blob_filter( return error; } -int git_blob_filtered_content( - git_buf *out, - git_blob *blob, - const char *path, - int check_for_binary_data) -{ - git_blob_filter_options opts = GIT_BLOB_FILTER_OPTIONS_INIT; - - if (check_for_binary_data) - opts.flags |= GIT_BLOB_FILTER_CHECK_FOR_BINARY; - else - opts.flags &= ~GIT_BLOB_FILTER_CHECK_FOR_BINARY; - - return git_blob_filter(out, blob, path, &opts); -} - /* Deprecated functions */ int git_blob_create_frombuffer( @@ -485,3 +469,19 @@ int git_blob_create_fromstream_commit( { return git_blob_create_from_stream_commit(out, stream); } + +int git_blob_filtered_content( + git_buf *out, + git_blob *blob, + const char *path, + int check_for_binary_data) +{ + git_blob_filter_options opts = GIT_BLOB_FILTER_OPTIONS_INIT; + + if (check_for_binary_data) + opts.flags |= GIT_BLOB_FILTER_CHECK_FOR_BINARY; + else + opts.flags &= ~GIT_BLOB_FILTER_CHECK_FOR_BINARY; + + return git_blob_filter(out, blob, path, &opts); +} |
