git

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASC  = SortDirection(asc)
	DESC = SortDirection(desc)
)

Variables

View Source
var (
	ErrNoTagFound           = errors.New("no tag found")
	ErrOneTagFound          = errors.New("one tag found")
	ErrInvalidSortDirection = errors.New("invalid sort direction")
	ErrPreReleaseVersion    = errors.New("invalid preReleaseVersion")
	ErrUndefinedSSHAuthSock = errors.New("SSH_AUTH_SOCK is not defined")
)
View Source
var EmptyRef = SemverRef{}

EmptyRef empty constructor nolint:gochecknoglobals

View Source
var EmptyRefList []SemverRef

EmptyRefList empty constructor nolint:gochecknoglobals

Functions

func BranchExists

func BranchExists(repo *gogit.Repository, branchName string) (bool, error)

func CreateTag

func CreateTag(repo *gogit.Repository, version, prefix string, dryRun bool) error

func CreateTagWithMessage

func CreateTagWithMessage(repo *gogit.Repository, version, prefix, message string,
	tagger *object.Signature, dryRun bool) error

func PushTag

func PushTag(r *gogit.Repository, version, prefix, remote string, dryRun bool, disableStrictHostChecking bool) error

func TagExists

func TagExists(r *gogit.Repository, tag string) (bool, error)

Types

type CurrentVersionFunc

type CurrentVersionFunc func(repo *gogit.Repository, prefix string, preRelease release.PreReleaseFunc) (SemverRef, error)

type PushTagFunc

type PushTagFunc func(
	repo *gogit.Repository,
	version, prefix, remote string,
	dryRun bool, disableStrictHostChecking bool) error

type SemverRef

type SemverRef struct {
	Version *semver.Version
	Ref     *plumbing.Reference
}

func CurrentVersion

func CurrentVersion(repo *gogit.Repository, prefix string, preRelease release.PreReleaseFunc) (SemverRef, error)

func LatestRef

func LatestRef(repo *gogit.Repository, prefix string) (SemverRef, error)

func ListRefs

func ListRefs(repo *gogit.Repository, prefix string, direction SortDirection, maxListSize int) ([]SemverRef, error)

func PreviousRef

func PreviousRef(repo *gogit.Repository, prefix string) (SemverRef, error)

type SemverRefColl

type SemverRefColl []SemverRef

SemverRefColl is a collection of Version instances and implements the sort interface. See the sort package for more details. https://golang.org/pkg/sort/

func (SemverRefColl) Len

func (c SemverRefColl) Len() int

Len returns the length of a collection. The number of Version instances on the slice.

func (SemverRefColl) Less

func (c SemverRefColl) Less(i, j int) bool

Less is needed for the sort interface to compare two Version objects on the slice. If checks if one is less than the other.

func (SemverRefColl) Swap

func (c SemverRefColl) Swap(i, j int)

Swap is needed for the sort interface to replace the Version objects at two different positions in the slice.

type SortDirection

type SortDirection string

func ParseSortDirection

func ParseSortDirection(str string) (SortDirection, error)

Jump to

Keyboard shortcuts

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