aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/transport/common.go2
-rw-r--r--plumbing/transport/common_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/plumbing/transport/common.go b/plumbing/transport/common.go
index 202c498..ac71bb3 100644
--- a/plumbing/transport/common.go
+++ b/plumbing/transport/common.go
@@ -227,7 +227,7 @@ func (e *fileEndpoint) String() string { return e.path }
var (
isSchemeRegExp = regexp.MustCompile(`^[^:]+://`)
- scpLikeUrlRegExp = regexp.MustCompile(`^(?:(?P<user>[^@]+)@)?(?P<host>[^:\s]+):(?:(?P<port>[0-9]+):)?(?P<path>[^\\].*)$`)
+ scpLikeUrlRegExp = regexp.MustCompile(`^(?:(?P<user>[^@]+)@)?(?P<host>[^:\s]+):(?:(?P<port>[0-9]{1,5})/)?(?P<path>[^\\].*)$`)
)
func parseSCPLike(endpoint string) (Endpoint, bool) {
diff --git a/plumbing/transport/common_test.go b/plumbing/transport/common_test.go
index f869d44..52759e6 100644
--- a/plumbing/transport/common_test.go
+++ b/plumbing/transport/common_test.go
@@ -75,7 +75,7 @@ func (s *SuiteCommon) TestNewEndpointSCPLike(c *C) {
}
func (s *SuiteCommon) TestNewEndpointSCPLikeWithPort(c *C) {
- e, err := NewEndpoint("git@github.com:9999:user/repository.git")
+ e, err := NewEndpoint("git@github.com:9999/user/repository.git")
c.Assert(err, IsNil)
c.Assert(e.Protocol(), Equals, "ssh")
c.Assert(e.User(), Equals, "git")