MCPcopy
hub / github.com/cli/cli / RemoteForRepo

Method RemoteForRepo

context/context.go:165–172  ·  view source on GitHub ↗

RemoteForRepo finds the git remote that points to a repository

(repo ghrepo.Interface)

Source from the content-addressed store, hash-verified

163
164// RemoteForRepo finds the git remote that points to a repository
165func (r *ResolvedRemotes) RemoteForRepo(repo ghrepo.Interface) (*Remote, error) {
166 for _, remote := range r.remotes {
167 if ghrepo.IsSame(remote, repo) {
168 return remote, nil
169 }
170 }
171 return nil, errors.New("not found")
172}

Callers 3

setDefaultRunFunction · 0.80
NewCreateContextFunction · 0.80
handlePushFunction · 0.80

Calls 1

IsSameFunction · 0.92

Tested by

no test coverage detected