Trim trailing .git, / from repo URIs

This commit is contained in:
Amolith 2024-02-23 15:51:24 -05:00
parent e107cf7338
commit edfeefee51
Signed by: Amolith
SSH Key Fingerprint: SHA256:JBKEeoO/72Fz03rtlzeO49PATFT2maMancH3opcT0h0
1 changed files with 3 additions and 0 deletions

View File

@ -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