From d2ffffecbd433617bebd968b37cfe70e25dafad0 Mon Sep 17 00:00:00 2001 From: Richard Gomez <32133502+rgmz@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:17:26 -0500 Subject: [PATCH] fix(git): remove .git suffix for links (#1716) --- detect/git.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/detect/git.go b/detect/git.go index bafafc9f..37968f58 100644 --- a/detect/git.go +++ b/detect/git.go @@ -146,10 +146,9 @@ func getRemoteUrl(source string) (*url.URL, error) { remoteUrl := string(bytes.TrimSpace(stdout)) if matches := sshUrlpat.FindStringSubmatch(remoteUrl); matches != nil { - host := matches[1] - repo := strings.TrimSuffix(matches[2], ".git") - remoteUrl = fmt.Sprintf("https://%s/%s", host, repo) + remoteUrl = fmt.Sprintf("https://%s/%s", matches[1], matches[2]) } + remoteUrl = strings.TrimSuffix(remoteUrl, ".git") parsedUrl, err := url.Parse(remoteUrl) if err != nil {