MCPcopy
hub / github.com/cli/cli / Matches

Method Matches

pkg/cmd/pr/shared/find_refs_resolution.go:106–110  ·  view source on GitHub ↗

Matches checks whether the provided baseBranchName and headRef match the refs. It is used to determine whether Pull Requests returned from the API

(baseBranchName, qualifiedHeadRef string)

Source from the content-addressed store, hash-verified

104// Matches checks whether the provided baseBranchName and headRef match the refs.
105// It is used to determine whether Pull Requests returned from the API
106func (r PRFindRefs) Matches(baseBranchName, qualifiedHeadRef string) bool {
107 headMatches := qualifiedHeadRef == r.QualifiedHeadRef()
108 baseMatches := r.baseBranchName.IsNone() || baseBranchName == r.baseBranchName.Unwrap()
109 return headMatches && baseMatches
110}
111
112func (r PRFindRefs) BaseRepo() ghrepo.Interface {
113 return r.baseRepo

Callers 4

TestPRFindRefsFunction · 0.80
findForRefsFunction · 0.80
updateSearchMethod · 0.80
updateSelectMethod · 0.80

Calls 3

QualifiedHeadRefMethod · 0.95
IsNoneMethod · 0.80
UnwrapMethod · 0.45

Tested by 1

TestPRFindRefsFunction · 0.64