summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-08-27 16:46:21 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2021-08-27 16:46:21 -0400
commitf593fa979319d628295cf7a4d57051e68caa4823 (patch)
tree4a14688e33774dd6d43f04379a214ff47dddb0b7
parentc1f4f45ef84d11d1baf41469eac28ec1b90dabf3 (diff)
downloadlibgit2-f593fa979319d628295cf7a4d57051e68caa4823.tar.gz
ident: use streaming filters
-rw-r--r--src/ident.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ident.c b/src/ident.c
index ae3ef1b45..e5aab80ed 100644
--- a/src/ident.c
+++ b/src/ident.c
@@ -113,6 +113,17 @@ static int ident_apply(
return ident_remove_id(to, from);
}
+static int ident_stream(
+ git_writestream **out,
+ git_filter *self,
+ void **payload,
+ const git_filter_source *src,
+ git_writestream *next)
+{
+ return git_filter_buffered_stream_new(out,
+ self, ident_apply, NULL, payload, src, next);
+}
+
git_filter *git_ident_filter_new(void)
{
git_filter *f = git__calloc(1, sizeof(git_filter));
@@ -122,7 +133,7 @@ git_filter *git_ident_filter_new(void)
f->version = GIT_FILTER_VERSION;
f->attributes = "+ident"; /* apply to files with ident attribute set */
f->shutdown = git_filter_free;
- f->apply = ident_apply;
+ f->stream = ident_stream;
return f;
}