From c2885642d6b726b9f4197bd1f6984a58d7257fe1 Mon Sep 17 00:00:00 2001 From: Katrina Verey Date: Tue, 10 Jan 2023 15:01:29 -0500 Subject: [PATCH] Remove unused param --- api/internal/git/repospec.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/internal/git/repospec.go b/api/internal/git/repospec.go index 8b3ba499aa..8f9c247776 100644 --- a/api/internal/git/repospec.go +++ b/api/internal/git/repospec.go @@ -237,7 +237,7 @@ func extractHost(n string) (string, string) { // Validate the username and scheme before attempting host/path parsing, because if the parsing // so far has not succeeded, we will not be able to extract the host and path correctly. - if err := validateUsernameAndScheme(username, scheme, acceptSCP); err != nil { + if err := validateScheme(scheme, acceptSCP); err != nil { // TODO: return this error instead. return "", n } @@ -290,13 +290,13 @@ func acceptSCPStyle(scheme, username string, isGithubURL bool) bool { return scheme == "" && (username != "" || isGithubURL) } -func validateUsernameAndScheme(username, scheme string, acceptSCPStyle bool) error { +func validateScheme(scheme string, acceptSCPStyle bool) error { // see https://git-scm.com/docs/git-fetch#_git_urls for info relevant to these validations switch scheme { case "": // Empty scheme is only ok if it's a Github URL or if it looks like SCP-style syntax if !acceptSCPStyle { - return fmt.Errorf("no username or scheme found") + return fmt.Errorf("failed to parse scheme") } case "ssh://", "file://", "https://", "http://": // These are all supported schemes