aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport')
-rw-r--r--plumbing/transport/http/common.go8
-rw-r--r--plumbing/transport/http/common_test.go2
-rw-r--r--plumbing/transport/server/server.go5
-rw-r--r--plumbing/transport/ssh/auth_method.go2
4 files changed, 6 insertions, 11 deletions
diff --git a/plumbing/transport/http/common.go b/plumbing/transport/http/common.go
index 5d3535e..38e903d 100644
--- a/plumbing/transport/http/common.go
+++ b/plumbing/transport/http/common.go
@@ -139,7 +139,7 @@ func (s *session) ApplyAuthToRequest(req *http.Request) {
return
}
- s.auth.setAuth(req)
+ s.auth.SetAuth(req)
}
func (s *session) ModifyEndpointIfRedirect(res *http.Response) {
@@ -175,7 +175,7 @@ func (*session) Close() error {
// AuthMethod is concrete implementation of common.AuthMethod for HTTP services
type AuthMethod interface {
transport.AuthMethod
- setAuth(r *http.Request)
+ SetAuth(r *http.Request)
}
func basicAuthFromEndpoint(ep *transport.Endpoint) *BasicAuth {
@@ -192,7 +192,7 @@ type BasicAuth struct {
Username, Password string
}
-func (a *BasicAuth) setAuth(r *http.Request) {
+func (a *BasicAuth) SetAuth(r *http.Request) {
if a == nil {
return
}
@@ -226,7 +226,7 @@ type TokenAuth struct {
Token string
}
-func (a *TokenAuth) setAuth(r *http.Request) {
+func (a *TokenAuth) SetAuth(r *http.Request) {
if a == nil {
return
}
diff --git a/plumbing/transport/http/common_test.go b/plumbing/transport/http/common_test.go
index 8b300e8..d9e0636 100644
--- a/plumbing/transport/http/common_test.go
+++ b/plumbing/transport/http/common_test.go
@@ -64,7 +64,7 @@ func (s *ClientSuite) TestNewTokenAuth(c *C) {
// Check header is set correctly
req, err := http.NewRequest("GET", "https://github.com/git-fixtures/basic", nil)
c.Assert(err, Equals, nil)
- a.setAuth(req)
+ a.SetAuth(req)
c.Assert(req.Header.Get("Authorization"), Equals, "Bearer OAUTH-TOKEN-TEXT")
}
diff --git a/plumbing/transport/server/server.go b/plumbing/transport/server/server.go
index 20bd12e..8e0dcc1 100644
--- a/plumbing/transport/server/server.go
+++ b/plumbing/transport/server/server.go
@@ -286,11 +286,6 @@ func (s *rpSession) updateReferences(req *packp.ReferenceUpdateRequest) {
continue
}
- if err != nil {
- s.setStatus(cmd.Name, err)
- continue
- }
-
ref := plumbing.NewHashReference(cmd.Name, cmd.New)
err := s.storer.SetReference(ref)
s.setStatus(cmd.Name, err)
diff --git a/plumbing/transport/ssh/auth_method.go b/plumbing/transport/ssh/auth_method.go
index dbb47c5..1e5c383 100644
--- a/plumbing/transport/ssh/auth_method.go
+++ b/plumbing/transport/ssh/auth_method.go
@@ -61,7 +61,7 @@ func (a *KeyboardInteractive) ClientConfig() (*ssh.ClientConfig, error) {
return a.SetHostKeyCallback(&ssh.ClientConfig{
User: a.User,
Auth: []ssh.AuthMethod{
- ssh.KeyboardInteractiveChallenge(a.Challenge),
+ a.Challenge,
},
})
}