jx: github.com/jenkins-x/jx/pkg/gits/testhelpers Index | Files

package testhelpers

import "github.com/jenkins-x/jx/pkg/gits/testhelpers"


Package Files


func Add Uses

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

Add adds all unstaged changes to the index.

func Branch Uses

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

Branch creates a new branch with the specified name.

func Checkout Uses

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

Checkout switches to the specified branch.

func Commit Uses

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

Commit commits all staged changes with the specified commit message.

func DetachHead Uses

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

DetachHead puts the repository in a detached head mode.

func GitCmd Uses

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 Uses

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 Uses

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

Merge merges the specified commits into the current branch

func ReadRef Uses

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 Uses

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 Uses

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

Tag creates an annotated tag.

func WriteFile Uses

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.

Package testhelpers imports 7 packages (graph). Updated 2019-08-13. Refresh now. Tools for package owners.