testhelpers

package
v2.1.63 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(fail func(string, ...int), repoDir string)

Add adds all unstaged changes to the index.

func Branch

func Branch(fail func(string, ...int), repoDir string, branch string)

Branch creates a new branch with the specified name.

func Checkout

func Checkout(fail func(string, ...int), repoDir string, branch string)

Checkout switches to the specified branch.

func Commit

func Commit(fail func(string, ...int), repoDir string, message string) string

Commit commits all staged changes with the specified commit message.

func DetachHead

func DetachHead(fail func(string, ...int), repoDir string)

DetachHead puts the repository in a detached head mode.

func GitCmd

func GitCmd(fail func(string, ...int), repoDir string, args ...string) string

GitCmd runs a git command with arguments in the specified git repository

func HeadSha

func HeadSha(fail func(string, ...int), repoDir string) string

HeadSha returns the commit SHA of the current HEAD commit within the specified git directory

func Merge

func Merge(fail func(string, ...int), repoDir string, commits ...string)

Merge merges the specified commits into the current branch

func ReadRef

func ReadRef(fail func(string, ...int), repoDir string, name string) string

ReadRef reads the commit SHA of the specified ref. Needs to be of the form /refs/heads/<name>.

func Revlist

func Revlist(fail func(string, ...int), repoDir string, maxCount int, commit string) string

Revlist lists commits that are reachable by following the parent links from the given commit

func Tag

func Tag(fail func(string, ...int), repoDir string, tag string, message string) string

Tag creates an annotated tag.

func WriteFile

func WriteFile(fail func(string, ...int), repoDir string, name string, contents string)

WriteFile creates a file with the specified name underneath the gitRepo directory adding the specified content. The file name can be path as well and intermediate directories are created.

Types

This section is empty.

Jump to

Keyboard shortcuts

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