git

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const Command = "git"
View Source
const DefaultAbbreviation = 7
View Source
const DefaultCommandTimeout = 15 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type DescribeOpts

type DescribeOpts struct {
	Tags   bool
	Abbrev int
	Match  string
}

func (*DescribeOpts) Args

func (o *DescribeOpts) Args() []string

type Error

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

func NewError

func NewError(command string, err error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(err error) bool

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Git

type Git interface {
	Describe(opts *DescribeOpts) (string, error)
	Log(query string, opts *LogOpts) ([]byte, error)
}

func New

func New(wd string) Git

func NewWithCommanderFactory

func NewWithCommanderFactory(newCommander commander.Factory) Git

type LogOpts

type LogOpts struct {
	Merges bool
}

func (*LogOpts) Args

func (o *LogOpts) Args() []string

type MockGit

type MockGit struct {
	mock.Mock
}

MockGit is an autogenerated mock type for the Git type

func NewMockGit added in v0.7.0

func NewMockGit(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockGit

NewMockGit creates a new instance of MockGit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockGit) Describe

func (_m *MockGit) Describe(opts *DescribeOpts) (string, error)

Describe provides a mock function with given fields: opts

func (*MockGit) Log

func (_m *MockGit) Log(query string, opts *LogOpts) ([]byte, error)

Log provides a mock function with given fields: query, opts

Jump to

Keyboard shortcuts

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