aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/client
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/client')
-rw-r--r--plumbing/transport/client/client.go5
-rw-r--r--plumbing/transport/client/client_test.go2
2 files changed, 5 insertions, 2 deletions
diff --git a/plumbing/transport/client/client.go b/plumbing/transport/client/client.go
index 5c6da05..770b7dc 100644
--- a/plumbing/transport/client/client.go
+++ b/plumbing/transport/client/client.go
@@ -4,6 +4,7 @@ import (
"fmt"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
+ "gopkg.in/src-d/go-git.v4/plumbing/transport/file"
"gopkg.in/src-d/go-git.v4/plumbing/transport/http"
"gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"
)
@@ -13,6 +14,7 @@ var Protocols = map[string]transport.Client{
"http": http.DefaultClient,
"https": http.DefaultClient,
"ssh": ssh.DefaultClient,
+ "file": file.DefaultClient,
}
// InstallProtocol adds or modifies an existing protocol.
@@ -21,7 +23,8 @@ func InstallProtocol(scheme string, c transport.Client) {
}
// NewClient returns the appropriate client among of the set of known protocols:
-// HTTP, SSH. See `InstallProtocol` to add or modify protocols.
+// http://, https://, ssh:// and file://.
+// See `InstallProtocol` to add or modify protocols.
func NewClient(endpoint transport.Endpoint) (transport.Client, error) {
f, ok := Protocols[endpoint.Scheme]
if !ok {
diff --git a/plumbing/transport/client/client_test.go b/plumbing/transport/client/client_test.go
index 0f4b2e5..a0c8208 100644
--- a/plumbing/transport/client/client_test.go
+++ b/plumbing/transport/client/client_test.go
@@ -38,7 +38,7 @@ func (s *ClientSuite) TestNewClientSSH(c *C) {
output, err := NewClient(e)
c.Assert(err, IsNil)
- c.Assert(typeAsString(output), Equals, "*ssh.client")
+ c.Assert(output, NotNil)
}
func (s *ClientSuite) TestNewClientUnknown(c *C) {