require a username for git over ssh

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
v0.8
Alex Couture-Beil 2020-12-10 12:49:59 -08:00 committed by Tõnis Tiigi
parent b64f992917
commit 23af9dcb86
2 changed files with 2 additions and 2 deletions

View File

@ -207,7 +207,7 @@ const (
gitProtocolUnknown
)
var gitSSHRegex = regexp.MustCompile("^([a-z0-9]+@)?[^:]+:.*$")
var gitSSHRegex = regexp.MustCompile("^[a-z0-9]+@[^:]+:.*$")
func getGitProtocol(remote string) (string, int) {
prefixes := map[string]int{

View File

@ -19,7 +19,7 @@ type GitIdentifier struct {
KnownSSHHosts string
}
var gitSSHRegex = regexp.MustCompile("^([a-z0-9]+@)?[^:]+:.*$")
var gitSSHRegex = regexp.MustCompile("^[a-z0-9]+@[^:]+:.*$")
func NewGitIdentifier(remoteURL string) (*GitIdentifier, error) {
repo := GitIdentifier{}