diff --git a/git/git.go b/git/git.go index 74eb277e55c75220aefda87357503dcfe5d153e5..db7d8391938eb4dbfebc6afaaad0ddaba0a5d6d3 100644 --- a/git/git.go +++ b/git/git.go @@ -177,10 +177,12 @@ func stringifyRepo(url string) (string, error) { return "", err } - if ep.Protocol == "http" || ep.Protocol == "https" { + switch ep.Protocol { + case "http", "https": return "data/" + strings.Split(url, "://")[1], nil - } else if ep.Protocol == "ssh" { + case "ssh": return "data/" + ep.Host + "/" + ep.Path, nil + default: + return "", errors.New("unsupported protocol") } - return "", errors.New("unsupported protocol") }