Documentation ¶
Index ¶
- type Commit
- type Commits
- type Git
- func (g *Git) CommitsIn(rev string) (Commits, error)
- func (g *Git) CreateCommit(message string, files ...string) (string, error)
- func (g *Git) CreateTag(commit, name, message string) (string, error)
- func (g *Git) HEAD() (string, string, error)
- func (g *Git) IsClean() (bool, error)
- func (g *Git) Pull(ctx context.Context) error
- func (g *Git) Push(ctx context.Context, remoteName string) error
- func (g *Git) PushTag(ctx context.Context, remoteName, tagName string) error
- func (g *Git) Remote(name string) (string, string, error)
- func (g *Git) Tag(name string) (Tag, error)
- func (g *Git) Tags() (Tags, error)
- type Signature
- type Tag
- type TagType
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct { Hash string Author Signature Committer Signature Message string Parents []string }
Commit represents a Git commit.
func (Commit) Before ¶
Before determines if a given commit is chronologically before another commit.
func (Commit) Equal ¶
Equal determines if two commits are the same. Two commits are the same if they both have the same hash.
func (Commit) ShortMessage ¶
ShortMessage returns a one-line truncated commit message.
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git provides Git functionalities.
func (*Git) CreateCommit ¶
CreateCommit stages a list of files in the working tree and then creates a new commit with a give message. If successful, it returns the hash of the newly created commit.
func (*Git) CreateTag ¶
CreateTag creates a new annotated tag with a message. If successful, it returns the hash of the newly created tag.
func (*Git) Pull ¶
Pull is same as git pull. It brings the changes from a remote repository into the current branch.
type Signature ¶
Signature determines who and when created a commit or tag.
func (Signature) After ¶
After determines if a given signature is chronologically after another signature.
type Tag ¶
type Tag struct { Type TagType Hash string Name string Tagger *Signature Message *string Commit Commit }
Tag represents a Git tag.
func (Tag) After ¶
After determines if a given tag is chronologically after another tag. Two tags are compared using the commits they refer to.
func (Tag) Before ¶
Before determines if a given tag is chronologically before another tag. Two tags are compared using the commits they refer to.
type Tags ¶
type Tags []Tag
Tags is a list of Git tags.
func (Tags) First ¶
First returns the first tag that satisifies the given predicate. If you pass a nil function, the first tag will be returned.
func (Tags) Last ¶
Last returns the last tag that satisifies the given predicate. If you pass a nil function, the last tag will be returned.