mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-22 20:48:27 +02:00
refactoring
This commit is contained in:
parent
63e24f8346
commit
6e2e737ae6
@ -6,10 +6,10 @@ package repo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
giturl "code.gitea.io/gitea/modules/git/url"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
@ -38,7 +38,8 @@ type Mirror struct {
|
||||
|
||||
// IsSSHRemoteAddress returns true if the mirror's remote address uses SSH.
|
||||
func (m *Mirror) IsSSHRemoteAddress() bool {
|
||||
return strings.HasPrefix(m.RemoteAddress, "ssh://")
|
||||
u, err := giturl.ParseGitURL(m.RemoteAddress)
|
||||
return err == nil && u.Scheme == "ssh"
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user