File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ func (m SSHAliasMap) Translator() func(*url.URL) *url.URL {
3030 if ! ok {
3131 return u
3232 }
33- // FIXME: cleanup domain logic
34- if strings .EqualFold (u .Hostname (), "github.com" ) && strings .EqualFold (resolvedHost , "ssh.github.com" ) {
35- return u
33+ if strings .EqualFold (resolvedHost , "ssh.github.com" ) {
34+ resolvedHost = "github.com"
3635 }
3736 newURL , _ := url .Parse (u .String ())
3837 newURL .Host = resolvedHost
Original file line number Diff line number Diff line change @@ -128,12 +128,14 @@ func Test_Translator(t *testing.T) {
128128 m := SSHAliasMap {
129129 "gh" : "github.com" ,
130130 "github.com" : "ssh.github.com" ,
131+ "my.gh.com" : "ssh.github.com" ,
131132 }
132133 tr := m .Translator ()
133134
134135 cases := [][]string {
135136 {"ssh://gh/o/r" , "ssh://github.com/o/r" },
136137 {"ssh://github.com/o/r" , "ssh://github.com/o/r" },
138+ {"ssh://my.gh.com" , "ssh://github.com" },
137139 {"https://gh/o/r" , "https://gh/o/r" },
138140 }
139141 for _ , c := range cases {
Original file line number Diff line number Diff line change 55require (
66 github.com/AlecAivazis/survey/v2 v2.3.2
77 github.com/MakeNowJust/heredoc v1.0.0
8- github.com/briandowns/spinner v1.13 .0
8+ github.com/briandowns/spinner v1.18 .0
99 github.com/charmbracelet/glamour v0.3.0
1010 github.com/cli/browser v1.1.0
1111 github.com/cli/oauth v0.9.0
Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
8181github.com/beorn7/perks v1.0.0 /go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8 =
8282github.com/beorn7/perks v1.0.1 /go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw =
8383github.com/bgentry/speakeasy v0.1.0 /go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs =
84- github.com/briandowns/spinner v1.13 .0 h1:q/Y9LtpwtvL0CRzXrAMj0keVXqNhBYUFg6tBOUiY8ek =
85- github.com/briandowns/spinner v1.13 .0 /go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ =
84+ github.com/briandowns/spinner v1.18 .0 h1:SJs0maNOs4FqhBwiJ3Gr7Z1D39/rukIVGQvpNZVHVcM =
85+ github.com/briandowns/spinner v1.18 .0 /go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ =
8686github.com/census-instrumentation/opencensus-proto v0.2.1 /go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU =
8787github.com/census-instrumentation/opencensus-proto v0.3.0 /go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU =
8888github.com/cespare/xxhash v1.1.0 /go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc =
You can’t perform that action at this time.
0 commit comments