git

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureCommitSince added in v0.4.5

func EnsureCommitSince(repo *git.Repository, ref *plumbing.Reference) error

EnsureCommitSince ensures that there is at least one commit since the given ref Returns ErrRefIsHead if the given ref is the current HEAD

func GetVersion

func GetVersion(repo *git.Repository, prefix string) (*plumbing.Reference, *semver.Version, error)

GetVersion returns the latest semver tag in a repo.

If no matching tag is found, returns a zero-valued semver.Version and a nil reference. This allows to bump the version whether or not a tag was found.

By default, prefix = "" In a monorepo, you might want to set prefix = "my/module/"

Types

type ErrRefIsHead added in v0.4.5

type ErrRefIsHead struct {
	Ref *plumbing.Reference
}

func (ErrRefIsHead) Error added in v0.4.5

func (e ErrRefIsHead) Error() string

Jump to

Keyboard shortcuts

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