git

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

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

Clean the output

func EmptyCommit

func EmptyCommit(t *testing.T, msg string)

EmptyCommit will create an empty commit without the need for modifying any existing files within the repository

func EmptyCommitAndTag

func EmptyCommitAndTag(t *testing.T, tag, msg string)

EmptyCommitAndTag will create an empty commit with an associated tag. No existing files will be modified within the repository

func EmptyCommits

func EmptyCommits(t *testing.T, msgs ...string)

EmptyCommits will create any number of empty commits without the need for modifying any existing files within the repository

func EmptyCommitsAndTag

func EmptyCommitsAndTag(t *testing.T, tag string, msgs ...string)

EmptyCommitsAndTag will create any number of empty commits and associate them with a tag. No existing files will be modified within the repository

func InitRepo

func InitRepo(t *testing.T)

InitRepo creates an empty git repository within a temporary directory. Once created the current testing context will operate from within that directory until the calling test has completed

func IsRepo

func IsRepo() bool

IsRepo identifies whether the current working directory is a recognised git repository

func LatestTag

func LatestTag() string

LatestTag retrieves the latest tag within the repository

func MkTmpDir

func MkTmpDir(t *testing.T)

MkTmpDir creates an empty directory that is not a git repository. Once created the current testing context will operate from within that directory until the calling test has completed

func Run

func Run(args ...string) (string, error)

Run executes a git command and returns its output or errors

func Tag

func Tag(tag string) error

Tag the repository and push it to the origin

Types

type Commit

type Commit struct {
	Message string
	Author  string
	Email   string
}

Commit contains metadata about a specific git commit

func LatestCommit

func LatestCommit() (Commit, error)

LatestCommit retrieves the latest commit within the repository

Jump to

Keyboard shortcuts

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