Documentation ¶
Index ¶
- type Git
- func (g *Git) Branch() (branch string, isBranch bool, err error)
- func (g *Git) Describe() (result string, err error)
- func (g *Git) Message() (message string, err error)
- func (g *Git) Ref() (ref string, err error)
- func (g *Git) SHA() (sha string, err error)
- func (g *Git) Status() (status string, isClean bool, err error)
- func (g *Git) Tag() (tag string, isTag bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Git ¶
type Git struct { Filesystem billy.Filesystem // contains filtered or unexported fields }
Git is a helper for git.
func NewGitFromClone ¶
func NewGitFromClone(url string, ref plumbing.ReferenceName) (g *Git, err error)
NewGitFromClone instantiates and returns a Git struct.
func (*Git) Describe ¶
Describe returns git describe-based version.
If no tags are present: `8513435-dirty` or `8513435`
Exactly on the tag `v0.1`: `v0.1-dirty` or `v0.1`
Some commits ahead of tag `v0.1`: `v0.1-1-g23cbce5` (1 commit ahead, `g` followed by abbreviated git SHA).
func (*Git) Message ¶
Message returns the commit message. In the case that a commit has multiple parents, the message of the last parent is returned.
Click to show internal directories.
Click to hide internal directories.