Commit fa1a4c77 by Edward Thomson

blob: deprecate `git_blob_filtered_content`

Users should now use `git_blob_filter`.
parent a008ceea
......@@ -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
*
......
......@@ -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
......
......@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment