diff options
Diffstat (limited to 'plumbing/transport/http/upload_pack.go')
-rw-r--r-- | plumbing/transport/http/upload_pack.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plumbing/transport/http/upload_pack.go b/plumbing/transport/http/upload_pack.go index fd1787c..8f73789 100644 --- a/plumbing/transport/http/upload_pack.go +++ b/plumbing/transport/http/upload_pack.go @@ -59,10 +59,9 @@ func (s *upSession) AdvertisedReferences() (*packp.AdvRefs, error) { return nil, err } - defer res.Body.Close() - - if res.StatusCode == http.StatusUnauthorized { - return nil, transport.ErrAuthorizationRequired + if err := NewErr(res); err != nil { + _ = res.Body.Close() + return nil, err } ar := packp.NewAdvRefs() |