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 /plumbing/transport/common.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 'plumbing/transport/common.go')
-rw-r--r-- | plumbing/transport/common.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plumbing/transport/common.go b/plumbing/transport/common.go index 00e8a30..3fcdef2 100644 --- a/plumbing/transport/common.go +++ b/plumbing/transport/common.go @@ -30,6 +30,7 @@ var ( ErrAuthorizationRequired = errors.New("authorization required") ErrEmptyUploadPackRequest = errors.New("empty git-upload-pack given") ErrInvalidAuthMethod = errors.New("invalid auth method") + ErrAlreadyConnected = errors.New("session already established") ) const ( @@ -41,9 +42,9 @@ const ( // It is implemented both by the client and the server, making this a RPC. type Transport interface { // NewUploadPackSession starts a git-upload-pack session for an endpoint. - NewUploadPackSession(Endpoint) (UploadPackSession, error) + NewUploadPackSession(Endpoint, AuthMethod) (UploadPackSession, error) // NewReceivePackSession starts a git-receive-pack session for an endpoint. - NewReceivePackSession(Endpoint) (ReceivePackSession, error) + NewReceivePackSession(Endpoint, AuthMethod) (ReceivePackSession, error) } type Session interface { @@ -52,8 +53,6 @@ type Session interface { // If the repository does not exist, returns ErrRepositoryNotFound. // If the repository exists, but is empty, returns ErrEmptyRemoteRepository. AdvertisedReferences() (*packp.AdvRefs, error) - //TODO: Move to Client level. - SetAuth(auth AuthMethod) error io.Closer } |