Documentation ¶
Overview ¶
Package gittest provides basic types and functions for testing operations related to Git repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestRepository ¶
func NewRepository ¶
func NewRepository() (testRepository *TestRepository, err error)
NewRepository creates a new TestRepository.
func (*TestRepository) AddCommit ¶
func (r *TestRepository) AddCommit(commitType string) (plumbing.Hash, error)
AddCommit adds a new commit with a given conventional commit type to the underlying Git repository.
func (*TestRepository) AddTag ¶
func (r *TestRepository) AddTag(tagName string, hash plumbing.Hash) error
AddTag adds a new tag to the underlying Git repository with a given name and pointing to a given hash.
func (*TestRepository) CheckoutBranch ¶
func (r *TestRepository) CheckoutBranch(name string) error
CheckoutBranch creates a new branch with the given name and checkout to it.
func (*TestRepository) Remove ¶
func (r *TestRepository) Remove() error
Remove removes the underlying Git repository.
func (*TestRepository) When ¶
func (r *TestRepository) When() time.Time
When returns a time.Time starting at 2000/01/01 00:00:00 and increasing of 10 second every new call.
Click to show internal directories.
Click to hide internal directories.