testutil

package
v0.0.0-...-99814c5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package testutil provides shared git test helpers for use across packages. It is not a _test.go file so it can be imported by test files in other packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chdir

func Chdir(t *testing.T, dir string)

Chdir changes the working directory to dir for the duration of the test, restoring the original directory in t.Cleanup.

func InitBareAndClone

func InitBareAndClone(t *testing.T) (bare, clone string)

InitBareAndClone creates a bare "remote" repo and clones it into a working directory. Returns (bare, clone) paths. The clone has an initial commit pushed to the remote and git identity configured.

func RunGit

func RunGit(t *testing.T, dir string, args ...string)

RunGit runs a git command in dir, failing the test on error.

func RunGitNoDir

func RunGitNoDir(t *testing.T, args ...string)

RunGitNoDir runs a git command in the current working directory, failing the test on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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