MCPcopy
hub / github.com/cli/cli / splitNameAndOwner

Function splitNameAndOwner

pkg/cmd/repo/create/create.go:968–977  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

966}
967
968func splitNameAndOwner(name string) (string, string, error) {
969 if !strings.Contains(name, "/") {
970 return name, "", nil
971 }
972 repo, err := ghrepo.FromFullName(name)
973 if err != nil {
974 return "", "", fmt.Errorf("argument error: %w", err)
975 }
976 return repo.RepoName(), repo.RepoOwner(), nil
977}

Callers 1

Calls 5

FromFullNameFunction · 0.92
ContainsMethod · 0.80
ErrorfMethod · 0.65
RepoNameMethod · 0.65
RepoOwnerMethod · 0.65

Tested by

no test coverage detected