aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
authorAntonio Jesus Navarro Perez <antnavper@gmail.com>2017-07-04 11:16:54 +0200
committerAntonio Jesus Navarro Perez <antnavper@gmail.com>2017-07-04 11:17:34 +0200
commit10bf320dce4b2a80394b24db19fad89e1da953f7 (patch)
treeb7a06e810b6a4acb47b27bdd39b0ded51c89031e /plumbing
parent97aa370451441a553b4b04f5fa3bdb8a42fead26 (diff)
downloadgo-git-10bf320dce4b2a80394b24db19fad89e1da953f7.tar.gz
fix auth error issue
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/transport/http/receive_pack.go4
-rw-r--r--plumbing/transport/http/receive_pack_test.go4
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