gittest

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFile added in v0.0.34

func AddFile(
	t *testing.T,
	repo *git.Repo,
	filepath string,
)

func CheckoutBranch added in v0.0.8

func CheckoutBranch(t *testing.T, repo *git.Repo, branch string) string

func CommitFile

func CommitFile(
	t *testing.T,
	repo *git.Repo,
	filename string,
	body []byte,
	cfOpts ...CommitFileOpt,
) string

func CreateFile added in v0.0.34

func CreateFile(
	t *testing.T,
	repo *git.Repo,
	filename string,
	body []byte,
) string

func NewTempRepo

func NewTempRepo(t *testing.T) *git.Repo

NewTempRepo initializes a new git repository with reasonable defaults.

func WithCheckoutBranch

func WithCheckoutBranch(t *testing.T, repo *git.Repo, branch string, f func())

WithCheckoutBranch runs the given function after checking out the specified branch. It returns to the original branch after the function returns.

Types

type CommitFileOpt added in v0.0.5

type CommitFileOpt func(*commitFileOpts)

func WithAmend added in v0.0.9

func WithAmend() CommitFileOpt

func WithMessage added in v0.0.5

func WithMessage(msg string) CommitFileOpt

Jump to

Keyboard shortcuts

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