diff options
-rw-r--r-- | plumbing/transport/http/receive_pack.go | 4 | ||||
-rw-r--r-- | plumbing/transport/http/receive_pack_test.go | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/plumbing/transport/http/receive_pack.go b/plumbing/transport/http/receive_pack.go index f867f97..b8489a7 100644 --- a/plumbing/transport/http/receive_pack.go +++ b/plumbing/transport/http/receive_pack.go @@ -43,6 +43,10 @@ func (s *rpSession) ReceivePack(req *packp.ReferenceUpdateRequest) ( } r, err := ioutil.NonEmptyReader(res.Body) + if err == ioutil.ErrEmptyReader { + return nil, nil + } + if err != nil { return nil, err } diff --git a/plumbing/transport/http/receive_pack_test.go b/plumbing/transport/http/receive_pack_test.go index 101a5b7..d870e5d 100644 --- a/plumbing/transport/http/receive_pack_test.go +++ b/plumbing/transport/http/receive_pack_test.go @@ -103,7 +103,9 @@ func freePort() (int, error) { const bareConfig = `[core] repositoryformatversion = 0 filemode = true -bare = true` +bare = true +[http] +receivepack = true` func prepareRepo(c *C, path string) { // git-receive-pack refuses to update refs/heads/master on non-bare repo |