MCPcopy
hub / github.com/cli/cli / NormalizeRepoName

Function NormalizeRepoName

pkg/cmd/repo/shared/repo.go:11–14  ·  view source on GitHub ↗

NormalizeRepoName takes in the repo name the user inputted and normalizes it using the same logic as GitHub (GitHub.com/new)

(repoName string)

Source from the content-addressed store, hash-verified

9
10// NormalizeRepoName takes in the repo name the user inputted and normalizes it using the same logic as GitHub (GitHub.com/new)
11func NormalizeRepoName(repoName string) string {
12 newName := invalidCharactersRE.ReplaceAllString(repoName, "-")
13 return strings.TrimSuffix(newName, ".git")
14}

Callers 4

forkRunFunction · 0.92
createFromScratchFunction · 0.92
createFromTemplateFunction · 0.92
TestNormalizeRepoNameFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestNormalizeRepoNameFunction · 0.68