git

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 5 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 {
	RepoPath string // RepoPath is the path to the git repository's root. Git commands executed by this Client will be run at this path.
}

Client is a wrapper around the git CLI tool.

func (Client) Commit

func (c Client) Commit(unstagedPaths []string, message string) error

Commit stages all given paths and commits with the given message.

func (Client) CommitHash

func (c Client) CommitHash() (string, error)

CommitHash returns a timestamp and commit hash for the HEAD commit of the given repository, formatted in the way expected for a go.mod file pseudo-version.

func (Client) Push

func (c Client) Push() error

Push pushes commits and tags to the repository.

func (Client) Tag

func (c Client) Tag(tag, message string) error

Tag creates an annotated git tag with the given message.

func (Client) Tags

func (c Client) Tags(prefix string) ([]string, error)

Tags returns all git tags with the given prefix.

type VcsClient

type VcsClient interface {
	Tag(tag, message string) error
	Tags(prefix string) ([]string, error)
	Commit(unstagedPaths []string, message string) error
	Push() error
	CommitHash() (string, error)
}

VcsClient is a client that interacts with a version control system.

Jump to

Keyboard shortcuts

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