mirror of
https://gitea.com/gitea/tea.git
synced 2024-06-03 10:11:22 +05:30
make SSHHOST include port, like a URL's host
This commit is contained in:
parent
16f3430174
commit
ee27407835
|
@ -228,5 +228,5 @@ func (l *Login) GetSSHHost() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
return u.Hostname()
|
||||
return u.Host
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ func contextFromLocalRepo(repoPath, remoteValue string) (*git.TeaRepo, *config.L
|
|||
return repo, &l, strings.TrimSuffix(path, ".git"), nil
|
||||
}
|
||||
} else if strings.EqualFold(p.Scheme, "ssh") {
|
||||
if sshHost == p.Hostname() {
|
||||
if sshHost == p.Host {
|
||||
return repo, &l, strings.TrimLeft(p.Path, "/"), nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,8 +90,8 @@ func CreateLogin(name, token, user, passwd, sshKey, giteaURL, sshCertPrincipal,
|
|||
}
|
||||
|
||||
// we do not have a method to get SSH config from api,
|
||||
// so we just use the hostname
|
||||
login.SSHHost = serverURL.Hostname()
|
||||
// so we just use the host
|
||||
login.SSHHost = serverURL.Host
|
||||
|
||||
if len(sshKey) == 0 {
|
||||
login.SSHKey, err = findSSHKey(client)
|
||||
|
|
Loading…
Reference in a new issue