diff --git a/db/Repository.go b/db/Repository.go index e79f9da32..ea89d5cea 100644 --- a/db/Repository.go +++ b/db/Repository.go @@ -15,7 +15,7 @@ type RepositoryType string const ( RepositoryGit RepositoryType = "git" RepositorySSH RepositoryType = "ssh" - RepositoryHTTPS RepositoryType = "https" + RepositoryHTTP RepositoryType = "https" RepositoryFile RepositoryType = "file" RepositoryLocal RepositoryType = "local" ) @@ -77,7 +77,7 @@ func (r Repository) GetFullPath(templateID int) string { func (r Repository) GetGitURL() string { url := r.GitURL - if r.GetType() == RepositoryHTTPS { + if r.GetType() == RepositoryHTTP { auth := "" switch r.SSHKey.Type { case AccessKeyLoginPassword: @@ -114,7 +114,14 @@ func (r Repository) GetType() RepositoryType { return RepositorySSH } - return RepositoryType(m[1]) + protocol := m[1] + + switch protocol { + case "http", "https": + return RepositoryHTTP + default: + return RepositoryType(protocol) + } } func (r Repository) Validate() error {