Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBlank ¶
func NewBlank() *blankContext
NewBlank initializes a blank Context suitable for testing
func ParseDefaultConfig ¶
func ParseDefaultConfig() (*configEntry, error)
ParseDefaultConfig reads the configuration file
Types ¶
type Context ¶
type Context interface { AuthToken() (string, error) SetAuthToken(string) AuthLogin() (string, error) Branch() (string, error) SetBranch(string) Remotes() (Remotes, error) BaseRepo() (ghrepo.Interface, error) SetBaseRepo(string) }
Context represents the interface for querying information about the current environment
type Remote ¶
Remote represents a git remote mapped to a GitHub repository
type Remotes ¶
type Remotes []*Remote
Remotes represents a set of git remotes
func (Remotes) FindByName ¶
FindByName returns the first Remote whose name matches the list
func (Remotes) FindByRepo ¶
FindByRepo returns the first Remote that points to a specific GitHub repository
type ResolvedRemotes ¶ added in v0.5.5
type ResolvedRemotes struct { BaseOverride ghrepo.Interface Remotes Remotes Network api.RepoNetworkResult // contains filtered or unexported fields }
func ResolveRemotesToRepos ¶ added in v0.5.5
func (ResolvedRemotes) BaseRepo ¶ added in v0.5.5
func (r ResolvedRemotes) BaseRepo() (*api.Repository, error)
BaseRepo is the first found repository in the "upstream", "github", "origin" git remote order, resolved to the parent repo if the git remote points to a fork
func (ResolvedRemotes) HeadRepo ¶ added in v0.5.5
func (r ResolvedRemotes) HeadRepo() (*api.Repository, error)
HeadRepo is a fork of base repo (if any), or the first found repository that has push access
func (ResolvedRemotes) RemoteForRepo ¶ added in v0.5.5
func (r ResolvedRemotes) RemoteForRepo(repo ghrepo.Interface) (*Remote, error)
RemoteForRepo finds the git remote that points to a repository