git

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShortHashLen = 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DescribeObject

type DescribeObject struct {
	Tag   *plumbing.Reference
	Count int
	Hash  plumbing.Hash
}

func (*DescribeObject) DokcerTag

func (desc *DescribeObject) DokcerTag() string

docker tag cann't contain '+'

func (*DescribeObject) SemanticVersion

func (desc *DescribeObject) SemanticVersion() string

This translates the "git describe" to an actual semver.org compatible semantic version that looks something like this:

v1.1.0-alpha.0.6+84c76d1142ea4d

type Repository

type Repository struct {
	*git.Repository
	// contains filtered or unexported fields
}

func Open

func Open(dir string) (*Repository, error)

func (*Repository) Describe

func (r *Repository) Describe(ref *plumbing.Reference) (*DescribeObject, error)

Describe the reference as 'git describe --tags' will do

func (*Repository) RemoteURL

func (r *Repository) RemoteURL(name string) (string, error)

func (*Repository) TreeState

func (r *Repository) TreeState() (TreeState, error)

type TreeState

type TreeState string
const (
	GitTreeClean TreeState = "clean"
	GitTreeDirty TreeState = "dirty"
)

Jump to

Keyboard shortcuts

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