BaseRepoFunc requests a list of Remotes, and selects the first one. Although Remotes is injected via the factory so it looks like the function might be configurable, in practice, it's calling readRemotes, and the injection is indirection. readRemotes makes use of the remoteResolver, which is respon
(remotesFunc func() (ghContext.Remotes, error))
| 72 | // |
| 73 | // With this resolution function, the upstream will always be chosen (assuming we have authenticated with github.com). |
| 74 | func BaseRepoFunc(remotesFunc func() (ghContext.Remotes, error)) func() (ghrepo.Interface, error) { |
| 75 | return func() (ghrepo.Interface, error) { |
| 76 | remotes, err := remotesFunc() |
| 77 | if err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | return remotes[0], nil |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // SmartBaseRepoFunc provides additional behaviour over BaseRepoFunc. Read the BaseRepoFunc |
| 85 | // documentation for more information on how remotes are fetched and ordered. |