git

package
v0.0.0-...-2a0a49f Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: BSD-4-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRepository = fs.ErrNotExist

Error when trying to parse a directory that is not a Git repository

Functions

This section is empty.

Types

type Git

type Git struct {
	// contains filtered or unexported fields
}

parser.VersionParser implementation using Git as data backend

func New

func New(cmd, root string) *Git

New creates a new parser.Parser instance using the provided directory as project root. the git executable is invoked using the provided path.

func NewSystem

func NewSystem(root string) *Git

NewSystem creates a new parser.Parser instance using the provided directory as project root. the git executable is invoked as-is, relying on its presence in one of the PATH directories.

func TryParse

func TryParse(cmd, path string) (*Git, error)

TryParse attempts to parse the given directory as Git repository using the provided command. If the given path does not seem to be a Git repository, ErrNoRepository is returned. All other errors are a result of file access problems or data corruption issues.

func TrySystemParse

func TrySystemParse(path string) (*Git, error)

TrySystemParse calls TryParse using the Git command found in the PATH

func (*Git) Equal

func (g *Git) Equal(o *Git) bool

Equal compares the fields of this instance to the given one

func (*Git) ParseVersionInfo

func (g *Git) ParseVersionInfo() (*buildinfo.VersionInfo, error)

ParseVersionInfo implements the parser.VersionParser interface

func (*Git) String

func (g *Git) String() string

String implements the fmt.Stringer interface

Jump to

Keyboard shortcuts

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