From fba146ac6867b13c40802c4d7a21a8a32571473c Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Sat, 13 Jul 2024 20:06:37 +0300 Subject: git: use system's git upload-pack This is an intermediate workaround for https://github.com/go-git/go-git/issues/1062. This should also fix #33. --- git/service/write_flusher.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 git/service/write_flusher.go (limited to 'git/service/write_flusher.go') diff --git a/git/service/write_flusher.go b/git/service/write_flusher.go new file mode 100644 index 0000000..f25a5ae --- /dev/null +++ b/git/service/write_flusher.go @@ -0,0 +1,25 @@ +package service + +import ( + "io" + "net/http" +) + +func newWriteFlusher(w http.ResponseWriter) io.Writer { + return writeFlusher{w.(interface { + io.Writer + http.Flusher + })} +} + +type writeFlusher struct { + wf interface { + io.Writer + http.Flusher + } +} + +func (w writeFlusher) Write(p []byte) (int, error) { + defer w.wf.Flush() + return w.wf.Write(p) +} -- cgit v1.2.3