[PATCH v5 06/29] interpret-trailers: buffer stdout output

Li Chen
2025-10-22T05:41:18Z

Simplified the non-in-place path in interpret_trailers
by writing the existing output strbuf directly to
stdout without creating a redundant temporary buffer.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
---
builtin/interpret-trailers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
index 2c8b6fc3b9..cdf39dbca8 100644
--- a/builtin/interpret-trailers.c
+++ b/builtin/interpret-trailers.c
@@ -122,7 +122,7 @@ static void interpret_trailers(const struct process_trailer_options *opts,
if (opts->in_place)
write_file_buf(file, out_buf.buf, out_buf.len);
else
- fwrite(out_buf.buf, 1, out_buf.len, stdout);
+ strbuf_write(&out_buf, stdout);

strbuf_release(&in_buf);
strbuf_release(&out_buf);
--
2.51.0