Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCancel ¶
func WithCancel(d DeferFunc, f func()) (DeferFunc, CancelFunc)
WithCancel returns a deferrable function that can be cancelled.
Types ¶
type File ¶
type File struct {
// Path is the path to the file.
Path string
// Contents are the file contents.
Contents []byte
// Mode is the file permissions mode.
Mode os.FileMode
}
File is a test file.
type TempDir ¶
type TempDir struct {
// contains filtered or unexported fields
}
TempDir is a temporary directory which is set up with a directory structure with some files for testing.
func NewTempDir ¶
NewTempDir creates a new TempDir. This creates a new temporary directory and fills it with the files given. Intermediate directories are created automatically with 0700 permissions. This function panics if an error occurs when creating the files.
type TestRepo ¶
type TestRepo struct {
// contains filtered or unexported fields
}
TestRepo is a repo created in a temporary directory.
func NewTestRepo ¶
NewTestRepo creates a new TestRepo with the given files committed into a single commit in the repo.
func (*TestRepo) Repository ¶
func (r *TestRepo) Repository() *git.Repository
Repository returns the git repository.
Click to show internal directories.
Click to hide internal directories.