Documentation ¶
Overview ¶
Package gittest provides utilities for testing git repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CmdAs ¶
func CmdAs(ts *testscript.TestScript, neg bool, args []string)
CmdAs sets the author and committer of the commits that follow.
as 'User Name <user@example.com>'
func CmdAt ¶
func CmdAt(ts *testscript.TestScript, neg bool, args []string)
CmdAt sets the author and commit time of the commits that follow.
at <YYYY-MM-DDTHH:MM:SS>
func CmdGit ¶
func CmdGit(ts *testscript.TestScript, neg bool, args []string)
CmdGit runs a git command in the repository.
[!] git [args ...]
Types ¶
type Config ¶
Config is a set of Git configuration values.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig is the default Git configuration for all test repositories.
type Fixture ¶
type Fixture struct {
// contains filtered or unexported fields
}
Fixture is a temporary directory that contains a Git repository built from a testscript file.
func LoadFixtureFile ¶
LoadFixtureFile loads a fixture file from the given path. The fixture file is expected to be testscript file that runs a series of git commands to set up a Git repository.
func LoadFixtureScript ¶
LoadFixtureScript loads a fixture from the testscript. It has access to the following commands in addition to testscript defaults: