Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchRequest ¶
type FetchRequest struct {
Remote string // name of the remote
RemoteRef string // ref to fetch
LocalRef string // name of the ref locally
}
FetchRequest is a request to fetch a branch.
type Git ¶
type Git interface {
// Determines the name of the current branch.
CurrentBranch() (string, error)
// Determines if a local branch with the given name exists.
DoesBranchExist(name string) bool
// Deletes the given branch.
DeleteBranch(name string) error
// Deletes the remote tracking branch with the given name.
DeleteRemoteTrackingBranch(remote, name string) error
// Create a branch with the given name and head but don't switch to it.
CreateBranch(name, head string) error
// Creates and switches to a local branch with the given name at the given
// ref.
CreateBranchAndSwitch(name, head string) error
// Switches branches.
Checkout(name string) error
// Fetch a ref
Fetch(*FetchRequest) error
// Push a branch
Push(*PushRequest) error
// Rebase a branch
Rebase(*RebaseRequest) error
// Get the SHA1 hash for the given ref.
SHA1(ref string) (string, error)
// Pulls a branch from a specific remote.
Pull(remote, name string) error
// Applies the given patch using git-am.
ApplyPatches(patches string) error
// RemoteURL gets the URL for the given remote.
RemoteURL(name string) (string, error)
}
Git is a gateway to access git locally.
type GitHub ¶
type GitHub interface {
// Checks if the given pull request branch is owned by the same
// repository.
IsOwned(br *github.PullRequestBranch) bool
// List pull requests on this repository with the given head. If owner is
// empty, the current repository should be used.
ListPullRequestsByHead(owner, branch string) ([]*github.PullRequest, error)
// List pull requests on this repository with the given merge base.
ListPullRequestsByBase(branch string) ([]*github.PullRequest, error)
// Retrieve the raw patch for the given pull request.
GetPullRequestPatch(number int) (string, error)
// Change the merge base for the given pull request.
SetPullRequestBase(number int, base string) error
// Merges the given pull request.
SquashPullRequest(*github.PullRequest) error
// Delete the given branch.
DeleteBranch(name string) error
}
GitHub is a gateway that provides access to GitHub operations on a specific repository.
type PushRequest ¶
PushRequest is a request to push a branch.
type RebaseRequest ¶ added in v0.2.1
type RebaseRequest struct {
Onto string // --onto
From string // if provided, we diff against this ref
Branch string // branch to rebase
}
RebaseRequest is a request to perform a Git rebase.
Click to show internal directories.
Click to hide internal directories.