提交 05c3dd3f 编写于 作者: M Mislav Marohnić

Normalize "ssh.github.com" hostname to just "github.com"

上级 8860670e
package github
import (
"fmt"
"os"
"strings"
......@@ -27,7 +26,7 @@ func (h GitHubHosts) Include(host string) bool {
func knownGitHubHosts() (hosts GitHubHosts) {
defaultHost := DefaultGitHubHost()
hosts = append(hosts, defaultHost)
hosts = append(hosts, fmt.Sprintf("ssh.%s", defaultHost))
hosts = append(hosts, "ssh." + GitHubHost)
ghHosts, _ := git.Config("hub.host")
for _, ghHost := range strings.Split(ghHosts, "\n") {
......
......@@ -143,6 +143,9 @@ func newProject(owner, name, host, protocol string) *Project {
if host == "" {
host = DefaultGitHubHost()
}
if host == "ssh.github.com" {
host = "github.com"
}
if protocol != "http" && protocol != "https" {
protocol = ""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册