git

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branch

func Branch(path string) (string, error)

func FindLatestCommit

func FindLatestCommit(repoPath string) (string, error)

FindLatestCommit determine the latest commit sha

func FindLatestTag

func FindLatestTag(repoPath string, tag string) (verzion.Verzion, error)

func FindShortCommitSha

func FindShortCommitSha(path string) (string, error)

func FindTagByHash

func FindTagByHash(repoPath string, hash string) (verzion.Verzion, error)

FindTagByHsh returns the tag version if the commit hash has a tag

func FromFileTags

func FromFileTags(repoPath string) (verzion.Verzion, error)

FromFileTags parses local file tags and returns the greatest Verzion.

func FromPackedRefs

func FromPackedRefs(repoPath string) (verzion.Verzion, error)

FromPackedRefs returns the last parsable packed ref.

func FromPatchBranch

func FromPatchBranch(path string) (verzion.Verzion, error)

func StubHead

func StubHead(t *testing.T, tempDir string, input []byte)

func StubPackedRefs

func StubPackedRefs(t *testing.T, tempDir string)

func StubRefsHead

func StubRefsHead(t *testing.T, tempDir string, branch string, input []byte)

func StubRefsTags

func StubRefsTags(t *testing.T, tempDir string, tags []Tag)

func StubVersion

func StubVersion(t *testing.T, tempDir string, version string)

Types

type Slice

type Slice []Tag

Slice is a sortable slice of Verzions.

func (Slice) Len

func (s Slice) Len() int

Len gives the length of a Slice.

func (Slice) Less

func (s Slice) Less(i, j int) bool

// Less returns true if the Verzion at s[i] is less than s[j]

func (Slice) Swap

func (s Slice) Swap(i, j int)

Swap swaps two Verzions in a Slice.

type Tag

type Tag struct {
	Hash    string
	Version verzion.Verzion
}

func (Tag) Less

func (t Tag) Less(cmp Tag) bool

Jump to

Keyboard shortcuts

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