git

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GitCmd func(env map[string]string, args ...string) (string, error)
	// contains filtered or unexported fields
}

Client is an empty struct to run git.

func NewGit

func NewGit(repoDir string) *Client

NewGit creates a new git instance.

func (*Client) AncestorTag added in v1.1.0

func (c *Client) AncestorTag(include, exclude, branch string) string

AncestorTag returns the previous tag that matches specific pattern if found.

func (Client) Clean

func (Client) Clean(output string, err error) (string, error)

Clean the output.

func (*Client) CurrentBranch

func (c *Client) CurrentBranch() (string, error)

CurrentBranch returns the current branch checked out.

func (*Client) IsRepo

func (c *Client) IsRepo() bool

IsRepo returns true if current folder is a git repository.

func (*Client) LatestTag

func (c *Client) LatestTag() string

LatestTag returns the latest tag if found.

func (*Client) MakeSafe added in v1.5.0

func (c *Client) MakeSafe() error

MakeSafe adds safe.directory global config.

func (*Client) Run

func (c *Client) Run(args ...string) (string, error)

Run runs a git command and returns its output or errors.

func (*Client) SourceBranch

func (c *Client) SourceBranch(commitHash string) (string, error)

SourceBranch tries to get branch from commit message.

Jump to

Keyboard shortcuts

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