diff options
author | Anthony Weems <amlweems@gmail.com> | 2017-01-17 11:17:11 -0600 |
---|---|---|
committer | Santiago M. Mola <santi@mola.io> | 2017-01-17 18:17:11 +0100 |
commit | 6593c757346f9817a770ff0ea091cce3e8243070 (patch) | |
tree | 6fbb72583931b0386e382177970650a9cdbca4eb /plumbing/transport/http/common.go | |
parent | 241e8ba00ac9533299d62dc38684305af2b6c301 (diff) | |
download | go-git-6593c757346f9817a770ff0ea091cce3e8243070.tar.gz |
transport: remove SetAuth, fixes #206 (#210)
* remove SetAuth functions, implement at NewUploadPackSession/NewReceivePackSession level.
* propagate transport.Auth from Fetch/Pull/Clone options to the transport API.
Diffstat (limited to 'plumbing/transport/http/common.go')
-rw-r--r-- | plumbing/transport/http/common.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/plumbing/transport/http/common.go b/plumbing/transport/http/common.go index 957fd07..a26cf0c 100644 --- a/plumbing/transport/http/common.go +++ b/plumbing/transport/http/common.go @@ -35,16 +35,16 @@ func NewClient(c *http.Client) transport.Transport { } } -func (c *client) NewUploadPackSession(ep transport.Endpoint) ( +func (c *client) NewUploadPackSession(ep transport.Endpoint, auth transport.AuthMethod) ( transport.UploadPackSession, error) { - return newUploadPackSession(c.c, ep), nil + return newUploadPackSession(c.c, ep, auth) } -func (c *client) NewReceivePackSession(ep transport.Endpoint) ( +func (c *client) NewReceivePackSession(ep transport.Endpoint, auth transport.AuthMethod) ( transport.ReceivePackSession, error) { - return newReceivePackSession(c.c, ep), nil + return newReceivePackSession(c.c, ep, auth) } type session struct { @@ -54,16 +54,6 @@ type session struct { advRefs *packp.AdvRefs } -func (s *session) SetAuth(auth transport.AuthMethod) error { - a, ok := auth.(AuthMethod) - if !ok { - return transport.ErrInvalidAuthMethod - } - - s.auth = a - return nil -} - func (*session) Close() error { return nil } |