File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,5 +106,7 @@ func findRemote(host string) (string, error) {
106106
107107// RemoteURL returns the git URL of app.
108108func RemoteURL (host , appID string ) string {
109+ // Strip off any trailing :port number after the host name.
110+ host = strings .Split (host , ":" )[0 ]
109111 return fmt .Sprintf ("ssh://git@%s:2222/%s.git" , host , appID )
110112}
Original file line number Diff line number Diff line change @@ -7,9 +7,15 @@ import (
77func TestRemoteURL (t * testing.T ) {
88 t .Parallel ()
99
10+ actual := RemoteURL ("example.com" , "app" )
1011 expected := "ssh://git@example.com:2222/app.git"
1112
12- actual := RemoteURL ("example.com" , "app" )
13+ if actual != expected {
14+ t .Errorf ("Expected %s, Got %s" , expected , actual )
15+ }
16+
17+ actual = RemoteURL ("deis.10.245.1.3.xip.io:31350" , "velcro-underdog" )
18+ expected = "ssh://git@deis.10.245.1.3.xip.io:2222/velcro-underdog.git"
1319
1420 if actual != expected {
1521 t .Errorf ("Expected %s, Got %s" , expected , actual )
You can’t perform that action at this time.
0 commit comments