Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
RepoInfo(owner, name string) (RepoInfo, error)
// Fork creates a fork and returns the fork's owner and name, which may
// differ from the original if the repository was renamed.
Fork(owner, name string) (forkOwner, forkName string, err error)
}
Client provides the GitHub API operations needed for fork decisions.
type CloneTarget ¶
type CloneTarget struct {
Repository Repository
Fork *Repository
}
CloneTarget describes what to clone and how to configure remotes. When Fork is non-nil, Repository is the upstream and Fork is the user's fork.
func ResolveCloneTarget ¶
func ResolveCloneTarget(owner, name string, fork *bool, client Client, prompter Prompter, diag io.Writer) (CloneTarget, error)
ResolveCloneTarget determines which repository to clone, forking if necessary.
fork controls forking behaviour:
- nil — default: prompt when the user lacks write access
- true — always fork (skip prompt); error if forking is disabled
- false — never fork; clone the original directly without prompting
When a fork is created, CloneTarget.Fork is set; the caller should clone Repository as upstream and add Fork as origin.
diag receives verbose diagnostic messages; pass io.Discard to suppress them.
type Repository ¶
func Parse ¶
func Parse(definition string) (Repository, error)
Click to show internal directories.
Click to hide internal directories.