Documentation ¶
Index ¶
- type Client
- type Repo
- func (r *Repo) Am(path string) error
- func (r *Repo) Checkout(commitlike string) error
- func (r *Repo) CheckoutNewBranch(branch string) error
- func (r *Repo) CheckoutPullRequest(number int) error
- func (r *Repo) Clean() error
- func (r *Repo) Config(key, value string) error
- func (r *Repo) Merge(commitlike string) (bool, error)
- func (r *Repo) Push(repo, branch string) error
- func (r *Repo) RevParse(commitlike string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Clean() error SetRemote(remote string) SetCredentials(user string, tokenGenerator func() []byte) Clone(repo string) (*Repo, error) }
Client represents a git client
type Repo ¶
type Repo struct { // Dir is the location of the git repo. Dir string // contains filtered or unexported fields }
Repo is a clone of a git repository. Launch with Client.Clone, and don't forget to clean it up after.
func (*Repo) Am ¶
Am tries to apply the patch in the given path into the current branch by performing a three-way merge (similar to git cherry-pick). It returns an error if the patch cannot be applied.
func (*Repo) CheckoutNewBranch ¶
CheckoutNewBranch creates a new branch and checks it out.
func (*Repo) CheckoutPullRequest ¶
CheckoutPullRequest does exactly that.
func (*Repo) Merge ¶
Merge attempts to merge commitlike into the current branch. It returns true if the merge completes. It returns an error if the abort fails.
Click to show internal directories.
Click to hide internal directories.