aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
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) {