summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-05-06 02:19:49 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2021-05-06 15:06:41 +0100
commit9869f1e5a30e735d3958c1fed3f6b0979d7f80de (patch)
tree2ea65693677648a1cec4d014294c10e40a804d7d /include
parent4bd172087c30e09e7720a7df11cace47ee002256 (diff)
downloadlibgit2-9869f1e5a30e735d3958c1fed3f6b0979d7f80de.tar.gz
filter: deprecate git_filter_list_stream_data
`git_filter_list_stream_data` takes user input in a `git_buf`. `git_buf` should only be used when libgit2 itself needs to allocate data and returned to a user that they can free when they wish. Replace it with `git_filter_list_stream_buffer` that takes a data buffer and length.
Diffstat (limited to 'include')
-rw-r--r--include/git2/deprecated.h24
-rw-r--r--include/git2/filter.h8
2 files changed, 29 insertions, 3 deletions
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 37857f8a2..a51950906 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -18,6 +18,7 @@
#include "describe.h"
#include "diff.h"
#include "errors.h"
+#include "filter.h"
#include "index.h"
#include "indexer.h"
#include "merge.h"
@@ -119,6 +120,29 @@ GIT_EXTERN(int) git_blob_filtered_content(
/**@}*/
+/** @name Deprecated Filter Functions
+ *
+ * These functions are retained for backward compatibility. The
+ * newer versions of these functions should be preferred in all
+ * new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+/** Deprecated in favor of `git_filter_list_stream_buffer`.
+ *
+ * @deprecated Use git_filter_list_stream_buffer
+ * @see Use git_filter_list_stream_buffer
+ */
+GIT_EXTERN(int) git_filter_list_stream_data(
+ git_filter_list *filters,
+ git_buf *data,
+ git_writestream *target);
+
+/**@}*/
+
/** @name Deprecated Tree Functions
*
* These functions are retained for backward compatibility. The
diff --git a/include/git2/filter.h b/include/git2/filter.h
index 886059051..641391b94 100644
--- a/include/git2/filter.h
+++ b/include/git2/filter.h
@@ -175,12 +175,14 @@ GIT_EXTERN(int) git_filter_list_apply_to_blob(
* Apply a filter list to an arbitrary buffer as a stream
*
* @param filters the list of filters to apply
- * @param data the buffer to filter
+ * @param buffer the buffer to filter
+ * @param len the size of the buffer
* @param target the stream into which the data will be written
*/
-GIT_EXTERN(int) git_filter_list_stream_data(
+GIT_EXTERN(int) git_filter_list_stream_buffer(
git_filter_list *filters,
- git_buf *data,
+ const char *buffer,
+ size_t len,
git_writestream *target);
/**