Skip to content

Commit dac771e

Browse files
authored
Merge branch 'trunk' into bump-cobra
2 parents 344f758 + 58864f4 commit dac771e

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

git/ssh_config.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

git/ssh_config_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.16
55
require (
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

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
8181
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
8282
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
8383
github.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=
8686
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
8787
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
8888
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=

0 commit comments

Comments
 (0)