git

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 7 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

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

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

func (*Client) Clean

func (c *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) 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