From 2d78ada1c852970850938319ff47bea201aa98e9 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Thu, 22 Jun 2017 17:13:01 +0800 Subject: [PATCH] Fix shallow clone (git clone --depth=1) Close the stdin pipe to force git-upload-pack exit, this acts like an EOF. --- git-http-backend.go | 1 + 1 file changed, 1 insertion(+) diff --git a/git-http-backend.go b/git-http-backend.go index c724095..e22ef07 100644 --- a/git-http-backend.go +++ b/git-http-backend.go @@ -129,6 +129,7 @@ func serviceRpc(hr HandlerReq) { } in.Write(input) + in.Close() io.Copy(w, stdout) cmd.Wait() }