Commit 9c3edca5bf56b5144e38c5ba3d91ae293270f5a3

John Alden 2022-05-13T15:05:05

Call legacy_write_fn if given

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/libgit2/filter.c b/src/libgit2/filter.c
index 20b2157..e2a927e 100644
--- a/src/libgit2/filter.c
+++ b/src/libgit2/filter.c
@@ -902,6 +902,16 @@ static int buffered_stream_close(git_writestream *s)
 
 	GIT_ASSERT_ARG(buffered_stream);
 
+#ifndef GIT_DEPRECATE_HARD
+	if(buffered_stream->write_fn == NULL) {
+		error = buffered_stream->legacy_write_fn(
+			buffered_stream->filter,
+			buffered_stream->payload,
+			(git_buf *)buffered_stream->output,
+			(git_buf *)&buffered_stream->input,
+			buffered_stream->source);
+	} else
+#endif
 	error = buffered_stream->write_fn(
 		buffered_stream->filter,
 		buffered_stream->payload,