Documentation
¶
Overview ¶
Package helpers provides test utilities for creating git repositories and scenarios.
Index ¶
- type TestRepo
- func (r *TestRepo) AddFile(filename string)
- func (r *TestRepo) AddRemote(name, url string)
- func (r *TestRepo) Branches() []string
- func (r *TestRepo) Checkout(branch string)
- func (r *TestRepo) Commit(message string)
- func (r *TestRepo) CommitWithDate(message string, date time.Time)
- func (r *TestRepo) CreateBranch(name string)
- func (r *TestRepo) CurrentBranch() string
- func (r *TestRepo) DetachHead()
- func (r *TestRepo) Merge(branch string)
- func (r *TestRepo) Push(remote, branch string)
- func (r *TestRepo) WriteFile(filename, content string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestRepo ¶
type TestRepo struct {
Path string
// contains filtered or unexported fields
}
TestRepo represents a test git repository
func NewTestRepo ¶
NewTestRepo creates a new test repository in a temporary directory
func (*TestRepo) CommitWithDate ¶
CommitWithDate creates a commit with a specific timestamp This is crucial for testing stale branch detection without waiting 30 days!
func (*TestRepo) CreateBranch ¶
CreateBranch creates a new branch
func (*TestRepo) CurrentBranch ¶
CurrentBranch returns the current branch name
func (*TestRepo) DetachHead ¶ added in v0.5.0
func (r *TestRepo) DetachHead()
DetachHead detaches HEAD at the current commit.
Click to show internal directories.
Click to hide internal directories.