aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorAnthony Weems <amlweems@gmail.com>2017-01-17 11:17:11 -0600
committerSantiago M. Mola <santi@mola.io>2017-01-17 18:17:11 +0100
commit6593c757346f9817a770ff0ea091cce3e8243070 (patch)
tree6fbb72583931b0386e382177970650a9cdbca4eb /remote.go
parent241e8ba00ac9533299d62dc38684305af2b6c301 (diff)
downloadgo-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.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/remote.go b/remote.go
index c3fa042..a071b07 100644
--- a/remote.go
+++ b/remote.go
@@ -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) {