summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-08-27 16:43:00 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2021-08-27 16:43:00 -0400
commitc1f4f45ef84d11d1baf41469eac28ec1b90dabf3 (patch)
tree4714f0cda379c6201c579f47d3c1b8c197a65932
parenta8943c04dcb8079595c075daf1b7ba76d4bb455e (diff)
downloadlibgit2-c1f4f45ef84d11d1baf41469eac28ec1b90dabf3.tar.gz
crlf: use streaming filters
-rw-r--r--src/crlf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/crlf.c b/src/crlf.c
index 1de9d8c3b..406f7140f 100644
--- a/src/crlf.c
+++ b/src/crlf.c
@@ -386,6 +386,17 @@ static int crlf_apply(
return crlf_apply_to_odb(*payload, to, from, src);
}
+static int crlf_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, crlf_apply, NULL, payload, src, next);
+}
+
static void crlf_cleanup(
git_filter *self,
void *payload)
@@ -405,7 +416,7 @@ git_filter *git_crlf_filter_new(void)
f->f.initialize = NULL;
f->f.shutdown = git_filter_free;
f->f.check = crlf_check;
- f->f.apply = crlf_apply;
+ f->f.stream = crlf_stream;
f->f.cleanup = crlf_cleanup;
return (git_filter *)f;