blob: deprecate `git_blob_filtered_content` Users should now use `git_blob_filter`.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
diff --git a/include/git2/blob.h b/include/git2/blob.h
index be721ed..3710f41 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 fec56b1..1abfd50 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 efc9fc8..1af3131 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);
+}