mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 04:04:25 +01:00
fix(git): remove .git suffix for links (#1716)
This commit is contained in:
1 parent
a43dc0d3d0
commit
d2ffffecbd
1 file changed
+2
-3
+2
-3
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user