Skip to content

Commit 1fe3713

Browse files
authored
Clean repository URL for error display (#91)
1 parent 0e5f70b commit 1fe3713

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/git/repository.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,11 @@ func repoName(u string) (string, error) {
223223
}
224224
parts := strings.Split(parsed.Path, "/")
225225
if len(parts) < 3 {
226-
return "", fmt.Errorf("could not identify repository name: %s", u)
226+
cleanedURL, err := CleanURL(u)
227+
if err != nil {
228+
return "", errors.New("failed to clean the URL when determining repository name")
229+
}
230+
return "", fmt.Errorf("could not identify repository name: %s", cleanedURL)
227231
}
228232
return strings.TrimSuffix(parts[len(parts)-1], ".git"), nil
229233
}

0 commit comments

Comments
 (0)