Documentation
¶
Overview ¶
Package git provides helpers for SCM.
Index ¶
- func HasGPGSignature(commit *object.Commit) bool
- func OpenRepository(path string) (*git.Repository, error)
- func ReadArmoredKeyrings(armoredKeyrings []string) (openpgp.EntityList, error)
- func VerifyPGPSignature(commit *object.Commit, keyring openpgp.EntityList) (*openpgp.Entity, error)
- type Git
- func (g *Git) AheadBehind(ref string) (ahead, behind int, err error)
- func (g *Git) CheckoutPullRequest(number int) (err error)
- func (g *Git) Commits(commit1, commit2 string) ([]*object.Commit, error)
- func (g *Git) FetchPullRequest(remote string, number int) (err error)
- func (g *Git) HeadCommit() (*object.Commit, error)
- func (g *Git) Message() (message string, err error)
- func (g *Git) SHA() (sha string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasGPGSignature ¶
HasGPGSignature returns true if the commit is signed.
func OpenRepository ¶
func OpenRepository(path string) (*git.Repository, error)
OpenRepository opens the repository containing path, including linked worktrees whose .git entry is a gitdir file.
func ReadArmoredKeyrings ¶
func ReadArmoredKeyrings(armoredKeyrings []string) (openpgp.EntityList, error)
ReadArmoredKeyrings parses a list of armored keyrings into a single keyring.
func VerifyPGPSignature ¶
VerifyPGPSignature validates the commit PGP signature against a keyring.
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git is a helper for git.
func (*Git) AheadBehind ¶
AheadBehind returns the number of commits that HEAD is ahead and behind relative to the specified ref.
func (*Git) CheckoutPullRequest ¶
CheckoutPullRequest checks out pull request.
func (*Git) Commits ¶
Commits returns the list of commits in the range commit1..commit2: the commits reachable from commit2 which are not reachable from commit1 (as `git log commit1..commit2`).
All parents of merge commits are followed, so commits merged into the range are included. The commits are returned newest first (breadth-first order starting from commit2).
func (*Git) FetchPullRequest ¶
FetchPullRequest fetches a remote PR.
func (*Git) HeadCommit ¶
HeadCommit returns the commit HEAD points to.