gittest

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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, os ...CommitFileOpt)

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