MCPcopy Index your code
hub / github.com/git-bug/git-bug / promptURL

Function promptURL

bridge/github/config.go:393–413  ·  view source on GitHub ↗
(repo repository.RepoCommon)

Source from the content-addressed store, hash-verified

391}
392
393func promptURL(repo repository.RepoCommon) (string, string, error) {
394 validRemotes, err := getValidGithubRemoteURLs(repo)
395 if err != nil {
396 return "", "", err
397 }
398
399 validator := func(name, value string) (string, error) {
400 _, _, err := splitURL(value)
401 if err != nil {
402 return err.Error(), nil
403 }
404 return "", nil
405 }
406
407 url, err := input.PromptURLWithRemote("Github project URL", "URL", validRemotes, input.Required, validator)
408 if err != nil {
409 return "", "", err
410 }
411
412 return splitURL(url)
413}
414
415// splitURL extract the owner and project from a github repository URL. It will remove the
416// '.git' extension from the URL before parsing it.

Callers 1

ConfigureMethod · 0.85

Calls 4

PromptURLWithRemoteFunction · 0.92
getValidGithubRemoteURLsFunction · 0.85
splitURLFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected