Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // RunCommand is mocked for tests. RunCommand = util.RunCmd // FilePathAbs is mocked for tests. FilePathAbs = filepath.Abs )
Functions ¶
func MockRunCommand ¶
MockRunCommand is sugar around MockRunCommandImpl, and returns a string with the arguments passed to RunCommand.
func MockRunCommandErrorsOn ¶
MockRunCommandErrorsOn is sugar around MockedRunCommandImpl and returns an error when invoked.
func MockRunCommandImpl ¶
MockRunCommandImpl records and return the arguments passed to RunCommand as a string. An errString may be passed to force the command to fail with an error, if the command executed contains the errString. Useful, when mocking functions with multiple calls to RunCommand. This seems super wrong to have a test function living in the `git` package.
Types ¶
type Git ¶
type Git struct {
Debug bool // Debug option set from CLI with debug state.
}
Git struct for adding methods.
func (*Git) CheckoutIndex ¶
func (g *Git) CheckoutIndex(repository repository.Repository) error
CheckoutIndex checkout Repository.Git to Repository.DstDir.
func (*Git) Clone ¶
func (g *Git) Clone(repository repository.Repository) error
Clone clone Repository.Git to Repository.getCloneDir, and hard checkout to Repository.Version.