aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/client/client.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-11-29 15:07:09 +0100
committerGitHub <noreply@github.com>2016-11-29 15:07:09 +0100
commit47007c70c5a696472576a522cd0e265a777f97a8 (patch)
tree2f49e52f42556a3707c24a263a571bcae39cfac6 /plumbing/transport/client/client.go
parent2c20b7e507a6514be2efa66143c13a60a87ee4b6 (diff)
downloadgo-git-47007c70c5a696472576a522cd0e265a777f97a8.tar.gz
transport: add local transport (#145)
* transport: move common packp protocol out of ssh transport. * fixtures: add fixture for empty repository. * transport: add file:// transport
Diffstat (limited to 'plumbing/transport/client/client.go')
-rw-r--r--plumbing/transport/client/client.go5
1 files changed, 4 insertions, 1 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 {