mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +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))
|
remoteUrl := string(bytes.TrimSpace(stdout))
|
||||||
if matches := sshUrlpat.FindStringSubmatch(remoteUrl); matches != nil {
|
if matches := sshUrlpat.FindStringSubmatch(remoteUrl); matches != nil {
|
||||||
host := matches[1]
|
remoteUrl = fmt.Sprintf("https://%s/%s", matches[1], matches[2])
|
||||||
repo := strings.TrimSuffix(matches[2], ".git")
|
|
||||||
remoteUrl = fmt.Sprintf("https://%s/%s", host, repo)
|
|
||||||
}
|
}
|
||||||
|
remoteUrl = strings.TrimSuffix(remoteUrl, ".git")
|
||||||
|
|
||||||
parsedUrl, err := url.Parse(remoteUrl)
|
parsedUrl, err := url.Parse(remoteUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user