git

package
v0.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2019 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 NewGit

func NewGit() (g *Git, err error)

NewGit instantiates and returns a Git struct.

func NewGitFromClone

func NewGitFromClone(url string, ref plumbing.ReferenceName) (g *Git, err error)

NewGitFromClone instantiates and returns a Git struct.

func (*Git) Branch

func (g *Git) Branch() (branch string, isBranch bool, err error)

Branch returns the current git branch name.

func (*Git) Message

func (g *Git) Message() (message string, err error)

Message returns the commit message. In the case that a commit has multiple parents, the message of the last parent is returned.

func (*Git) Ref

func (g *Git) Ref() (ref string, err error)

Ref returns the current git ref name.

func (*Git) SHA

func (g *Git) SHA() (sha string, err error)

SHA returns the sha of the current commit.

func (*Git) Status

func (g *Git) Status() (status string, isClean bool, err error)

Status returns the status of the working tree.

func (*Git) Tag

func (g *Git) Tag() (tag string, isTag bool, err error)

Tag returns the tag name if HEAD is a tag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL