git

package
v0.0.0-...-b3494e8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeRepo

type FakeRepo struct {
	TreeHashForHeadRoot  string
	TreeHashForHeadVal   map[string]string
	CommitHashForHeadVal string
	TagsForHeadVal       []string
	IsWIPVal             map[string]bool
	IsWIPRoot            bool
	IsDevVal             bool
}

func (*FakeRepo) CommitHashForHead

func (f *FakeRepo) CommitHashForHead(short bool) (string, error)

func (*FakeRepo) IsDev

func (f *FakeRepo) IsDev(string) (bool, error)

func (*FakeRepo) IsWIP

func (f *FakeRepo) IsWIP(path string) (bool, error)

func (*FakeRepo) SemVerTagForHead

func (f *FakeRepo) SemVerTagForHead(ignoreParserErrors bool) (*semver.Version, error)

func (*FakeRepo) TagsForHead

func (f *FakeRepo) TagsForHead() ([]string, error)

func (*FakeRepo) TreeHashForHead

func (f *FakeRepo) TreeHashForHead(path string) (string, error)

type Git

type Git interface {
	TreeHashForHead(string) (string, error)
	CommitHashForHead(short bool) (string, error)
	TagsForHead() ([]string, error)
	SemVerTagForHead(bool) (*semver.Version, error)
	IsWIP(string) (bool, error)
	IsDev(string) (bool, error)
}

type GitRepo

type GitRepo struct {
	TopLevel string // actual path of the repo as seen by git
	// contains filtered or unexported fields
}

func New

func New(repoPath string) (*GitRepo, error)

func (*GitRepo) CommitHashForHead

func (g *GitRepo) CommitHashForHead(short bool) (string, error)

func (*GitRepo) IsDev

func (g *GitRepo) IsDev(baseBranch string) (bool, error)

IsDev check if current branch has diverged from the base branch

func (*GitRepo) IsWIP

func (g *GitRepo) IsWIP(path string) (bool, error)

IsWIP check if any checked-in files had been modified, but it ignores files that new files that had not been checked in

func (*GitRepo) SemVerTagForHead

func (g *GitRepo) SemVerTagForHead(ignoreParserErrors bool) (*semver.Version, error)

func (*GitRepo) TagsForHead

func (g *GitRepo) TagsForHead() ([]string, error)

func (*GitRepo) TreeHashForHead

func (g *GitRepo) TreeHashForHead(path string) (string, error)

Jump to

Keyboard shortcuts

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