gitutil

package
v0.13.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitAdd

func GitAdd(c *Git, tb testing.TB, files ...string)

func GitCheckoutBranch

func GitCheckoutBranch(c *Git, tb testing.TB, name string)

func GitCommit

func GitCommit(c *Git, tb testing.TB, msg string)

func GitInit

func GitInit(c *Git, tb testing.TB)

func GitServeHTTP added in v0.11.0

func GitServeHTTP(c *Git, t testing.TB) (url string)

func GitSetMainUpstream added in v0.13.0

func GitSetMainUpstream(c *Git, tb testing.TB, remote, target string)

func GitSetRemote

func GitSetRemote(c *Git, tb testing.TB, name string, url string)

func GitTag

func GitTag(c *Git, tb testing.TB, tag string)

func IsAmbiguousArgument added in v0.10.3

func IsAmbiguousArgument(err error) bool

func IsUnknownRevision added in v0.10.3

func IsUnknownRevision(err error) bool

func Mktmp

func Mktmp(tb testing.TB) string

Types

type Git

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

Git represents an active git object

func New

func New(opts ...Option) (*Git, error)

New initializes a new git client

func (*Git) FullCommit

func (c *Git) FullCommit() (string, error)

func (*Git) GitDir added in v0.11.0

func (c *Git) GitDir() (string, error)

func (*Git) IsDirty

func (c *Git) IsDirty() bool

func (*Git) IsInsideWorkTree

func (c *Git) IsInsideWorkTree() bool

func (*Git) RemoteURL

func (c *Git) RemoteURL() (string, error)

func (*Git) RootDir

func (c *Git) RootDir() (string, error)

func (*Git) ShortCommit

func (c *Git) ShortCommit() (string, error)

func (*Git) Tag

func (c *Git) Tag() (string, error)

type Option

type Option func(b *Git)

Option provides a variadic option for configuring the git client.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets context.

func WithWorkingDir

func WithWorkingDir(wd string) Option

WithWorkingDir sets working directory.

Jump to

Keyboard shortcuts

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