From edfeefee519e87699c03ffb1460e1812fcc47c9d Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 23 Feb 2024 15:51:24 -0500 Subject: [PATCH] Trim trailing .git, / from repo URIs --- git/git.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git/git.go b/git/git.go index 098dd37..1f3d5f3 100644 --- a/git/git.go +++ b/git/git.go @@ -190,6 +190,9 @@ func dirEmpty(name string) (empty bool, err error) { // stringifyRepo accepts a repository URI string and the corresponding local // filesystem path, whether the URI is HTTP, HTTPS, or SSH. func stringifyRepo(url string) (path string, err error) { + url = strings.TrimSuffix(url, ".git") + url = strings.TrimSuffix(url, "/") + ep, err := transport.NewEndpoint(url) if err != nil { return "", err