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 /remote.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 'remote.go')
-rw-r--r-- | remote.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -72,7 +72,7 @@ func (r *Remote) Push(o *PushOptions) (err error) { return fmt.Errorf("remote names don't match: %s != %s", o.RemoteName, r.c.Name) } - s, err := newSendPackSession(r.c.URL) + s, err := newSendPackSession(r.c.URL, o.Auth) if err != nil { return err } @@ -132,7 +132,7 @@ func (r *Remote) fetch(o *FetchOptions) (refs storer.ReferenceStorer, err error) o.RefSpecs = r.c.Fetch } - s, err := newUploadPackSession(r.c.URL) + s, err := newUploadPackSession(r.c.URL, o.Auth) if err != nil { return nil, err } @@ -175,22 +175,22 @@ func (r *Remote) fetch(o *FetchOptions) (refs storer.ReferenceStorer, err error) return remoteRefs, err } -func newUploadPackSession(url string) (transport.UploadPackSession, error) { +func newUploadPackSession(url string, auth transport.AuthMethod) (transport.UploadPackSession, error) { c, ep, err := newClient(url) if err != nil { return nil, err } - return c.NewUploadPackSession(ep) + return c.NewUploadPackSession(ep, auth) } -func newSendPackSession(url string) (transport.ReceivePackSession, error) { +func newSendPackSession(url string, auth transport.AuthMethod) (transport.ReceivePackSession, error) { c, ep, err := newClient(url) if err != nil { return nil, err } - return c.NewReceivePackSession(ep) + return c.NewReceivePackSession(ep, auth) } func newClient(url string) (transport.Transport, transport.Endpoint, error) { |