MCPcopy Index your code
hub / github.com/rilldata/rill / normalizeGitRemote

Function normalizeGitRemote

admin/server/github.go:1300–1308  ·  view source on GitHub ↗

normalizeGitRemote adds a .git suffix to the Git remote URL if it doesn't already have one. If it's not a Github URL, it returns the string as is. This is for backwards compatibility with old CLIs that sent Github HTML URLs instead of Github remote URLs.

(remote string)

Source from the content-addressed store, hash-verified

1298// If it's not a Github URL, it returns the string as is.
1299// This is for backwards compatibility with old CLIs that sent Github HTML URLs instead of Github remote URLs.
1300func normalizeGitRemote(remote string) string {
1301 if !strings.HasPrefix(remote, "https://github.com") {
1302 return remote // Not a Github remote, return as is
1303 }
1304 if strings.HasSuffix(remote, ".git") {
1305 return remote
1306 }
1307 return remote + ".git"
1308}

Callers 8

GetGithubRepoStatusMethod · 0.85
githubConnectCallbackMethod · 0.85
githubAuthMethod · 0.85
githubAuthCallbackMethod · 0.85
githubStatusMethod · 0.85
CreateProjectMethod · 0.85
UpdateProjectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected