MCPcopy Create free account
hub / github.com/cli/cli / splitNameAndOwner

Function splitNameAndOwner

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

Source from the content-addressed store, hash-verified

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

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