Documentation
¶
Index ¶
- Variables
- func EnsureIsBare(fs billy.Filesystem) error
- type Fixture
- func (f *Fixture) Clone() *Fixture
- func (f *Fixture) DotGit(opts ...Option) billy.Filesystem
- func (f *Fixture) Idx() billy.File
- func (f *Fixture) Is(tag string) bool
- func (f *Fixture) Packfile() billy.File
- func (f *Fixture) Rev() billy.File
- func (f *Fixture) Worktree(opts ...Option) billy.Filesystem
- type Fixtures
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var Filesystem = embedfs.New(&data)
Functions ¶
func EnsureIsBare ¶
func EnsureIsBare(fs billy.Filesystem) error
EnsureIsBare overrides the config file with one where bare is true.
Types ¶
type Fixture ¶
type Fixture struct { URL string Tags []string Head string PackfileHash string DotGitHash string WorktreeHash string ObjectsCount int32 }
type Option ¶
type Option func(*options)
func WithMemFS ¶
func WithMemFS() Option
WithMemFS returns the option of using memfs for the fs created for Fixtures.
func WithTargetDir ¶
WithTargetDir returns the option of using an OS-based filesystem based on a target dir. The target dir will be based on the name returned from dirName, which aligns with tempdir functions in different testing frameworks (e.g. t.TempDir, c.MkDir).
The caller is responsible for removing the dir from disk. Therefore, it is recommended to delegate that to the testing framework:
Go:
WithTargetDir(t.TempDir)
Check Framework:
WithTargetDir(c.Mkdir)
Click to show internal directories.
Click to hide internal directories.