Documentation
¶
Overview ¶
Package gittest provides basic types and functions for testing operations related to Git repositories.
Index ¶
- type TestRepository
- func (r *TestRepository) AddCommit(commitType string) (plumbing.Hash, error)
- func (r *TestRepository) AddCommitWithSpecificFile(commitType, filePath string) (plumbing.Hash, error)
- func (r *TestRepository) AddTag(tagName string, hash plumbing.Hash) error
- func (r *TestRepository) CheckoutBranch(name string) error
- func (r *TestRepository) Remove() error
- func (r *TestRepository) When() time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestRepository ¶
type TestRepository struct { *git.Repository RemoteServer *http.Server RemoteURL string Path string Counter uint }
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) AddCommitWithSpecificFile ¶
func (r *TestRepository) AddCommitWithSpecificFile(commitType, filePath string) (plumbing.Hash, error)
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.