Skip to content

Commit 59ec87c

Browse files
authored
Merge branch 'release-1.5' into release-1.5-backport-1731
2 parents 0b4152d + e3afd7b commit 59ec87c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

config/endpoint.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func NewEndpointWithConfig(rawurl string, c *Configuration) Endpoint {
5656
rawurl = c.ReplaceUrlAlias(rawurl)
5757
u, err := url.Parse(rawurl)
5858
if err != nil {
59-
return Endpoint{Url: EndpointUrlUnknown}
59+
return endpointFromBareSshUrl(rawurl)
6060
}
6161

6262
switch u.Scheme {
@@ -67,7 +67,7 @@ func NewEndpointWithConfig(rawurl string, c *Configuration) Endpoint {
6767
case "git":
6868
return endpointFromGitUrl(u, c)
6969
case "":
70-
return endpointFromBareSshUrl(u)
70+
return endpointFromBareSshUrl(u.String())
7171
default:
7272
// Just passthrough to preserve
7373
return Endpoint{Url: rawurl}
@@ -78,11 +78,11 @@ func NewEndpointWithConfig(rawurl string, c *Configuration) Endpoint {
7878
//
7979
// [email protected]:path/to/repo.git
8080
//
81-
func endpointFromBareSshUrl(u *url.URL) Endpoint {
82-
parts := strings.Split(u.Path, ":")
81+
func endpointFromBareSshUrl(rawurl string) Endpoint {
82+
parts := strings.Split(rawurl, ":")
8383
partsLen := len(parts)
8484
if partsLen < 2 {
85-
return Endpoint{Url: u.String()}
85+
return Endpoint{Url: rawurl}
8686
}
8787

8888
// Treat presence of ':' as a bare URL

0 commit comments

Comments
 (0)