diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-24 20:40:33 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-24 22:00:44 +0200 |
commit | 0fa6f26b0e6ca242088794027c0a32d01e1bc6f9 (patch) | |
tree | 40b294855cd5b8fe28fe97786ce953c6704ca601 /clients/ssh/git_upload_pack.go | |
parent | 9ae3c5808fcfa468d1f9394c9b16bc02f573ba79 (diff) | |
download | go-git-0fa6f26b0e6ca242088794027c0a32d01e1bc6f9.tar.gz |
clients/ssh: test fix
Diffstat (limited to 'clients/ssh/git_upload_pack.go')
-rw-r--r-- | clients/ssh/git_upload_pack.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clients/ssh/git_upload_pack.go b/clients/ssh/git_upload_pack.go index 551ab9c..03b289a 100644 --- a/clients/ssh/git_upload_pack.go +++ b/clients/ssh/git_upload_pack.go @@ -42,15 +42,19 @@ type GitUploadPackService struct { } // NewGitUploadPackService initialises a GitUploadPackService. -// TODO: remove this, as the struct is zero-value safe. func NewGitUploadPackService(endpoint common.Endpoint) common.GitUploadPackService { return &GitUploadPackService{endpoint: endpoint} } // Connect cannot be used with SSH clients and always return // ErrAuthRequired. Use ConnectWithAuth instead. -func (s *GitUploadPackService) Connect() (err error) { - return ErrAuthRequired +func (s *GitUploadPackService) Connect() error { + auth, err := NewSSHAgentAuth() + if err != nil { + return err + } + + return s.ConnectWithAuth(auth) } // ConnectWithAuth connects to ep using SSH. Authentication is handled |