MCPcopy
hub / github.com/cli/cli / IsSame

Function IsSame

internal/ghrepo/repo.go:79–83  ·  view source on GitHub ↗

IsSame compares two GitHub repositories

(a, b Interface)

Source from the content-addressed store, hash-verified

77
78// IsSame compares two GitHub repositories
79func IsSame(a, b Interface) bool {
80 return strings.EqualFold(a.RepoOwner(), b.RepoOwner()) &&
81 strings.EqualFold(a.RepoName(), b.RepoName()) &&
82 normalizeHostname(a.RepoHost()) == normalizeHostname(b.RepoHost())
83}
84
85func GenerateRepoURL(repo Interface, p string, args ...interface{}) string {
86 baseURL := fmt.Sprintf("%s%s/%s", ghinstance.HostPrefix(repo.RepoHost()), repo.RepoOwner(), repo.RepoName())

Callers 15

RemoteForRepoMethod · 0.92
TestNewCmdCommentFunction · 0.92
TestNewCmdCreateFunction · 0.92
TestNewCmdEditFunction · 0.92
TestNewCmdListFunction · 0.92
closeRunFunction · 0.92
TestNewCmdCloseFunction · 0.92
TestNewCmdDevelopFunction · 0.92
TestNewCmdTransferFunction · 0.92
ParseIssuesFromArgsFunction · 0.92
TestArgParsingFunction · 0.92

Calls 4

normalizeHostnameFunction · 0.85
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65
RepoHostMethod · 0.65

Tested by 15

TestNewCmdCommentFunction · 0.74
TestNewCmdCreateFunction · 0.74
TestNewCmdEditFunction · 0.74
TestNewCmdListFunction · 0.74
TestNewCmdCloseFunction · 0.74
TestNewCmdDevelopFunction · 0.74
TestNewCmdTransferFunction · 0.74
TestArgParsingFunction · 0.74
TestNewCmdEditFunction · 0.74