Documentation ¶
Overview ¶
Package git provides a client to plugins that can do git operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Logger will be used to log git operations and must be set. Logger *logrus.Entry // contains filtered or unexported fields }
Client can clone repos. It keeps a local cache, so successive clones of the same repo should be quick. Create with NewClient. Be sure to clean it up.
func NewClient ¶
NewClient returns a client that talks to GitHub. It will fail if git is not in the PATH.
func (*Client) Clone ¶
Clone clones a repository. Pass the full repository name, such as "kubernetes/test-infra" as the repo. This function may take a long time if it is the first time cloning the repo. In that case, it must do a full git mirror clone. For large repos, this can take a while. Once that is done, it will do a git fetch instead of a clone, which will usually take at most a few seconds.
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. Create with Client.Clone, and don't forget to clean it up after.
func (*Repo) CheckoutPullRequest ¶
CheckoutPullRequest does exactly that.