Documentation ¶
Index ¶
- type CommitFileOpt
- type GitTestRepo
- func (r *GitTestRepo) AddFile(t *testing.T, fp string)
- func (r *GitTestRepo) AsAvGitRepo() *avgit.Repo
- func (r *GitTestRepo) CheckoutBranch(t *testing.T, branch plumbing.ReferenceName) plumbing.ReferenceName
- func (r *GitTestRepo) CheckoutCommit(t *testing.T, hash plumbing.Hash)
- func (r *GitTestRepo) CommitFile(t *testing.T, filename string, body string, cfOpts ...CommitFileOpt) plumbing.Hash
- func (r *GitTestRepo) CreateFile(t *testing.T, filename string, body string) string
- func (r *GitTestRepo) CreateRef(t *testing.T, ref plumbing.ReferenceName)
- func (r *GitTestRepo) CurrentBranch(t *testing.T) plumbing.ReferenceName
- func (r *GitTestRepo) GetCommitAtRef(t *testing.T, name plumbing.ReferenceName) plumbing.Hash
- func (r *GitTestRepo) GetCommits(t *testing.T, includedFromRef, excludedFromRef plumbing.ReferenceName) []plumbing.Hash
- func (r *GitTestRepo) Git(t *testing.T, args ...string) string
- func (r *GitTestRepo) IsWorkdirClean(t *testing.T) bool
- func (r *GitTestRepo) MergeBase(t *testing.T, ref1, ref2 plumbing.ReferenceName) []plumbing.Hash
- func (r *GitTestRepo) OpenDB(t *testing.T) *jsonfiledb.DB
- func (r *GitTestRepo) WithCheckoutBranch(t *testing.T, branch plumbing.ReferenceName, f func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitFileOpt ¶ added in v0.0.5
type CommitFileOpt func(*commitFileOpts)
func WithAmend ¶ added in v0.0.9
func WithAmend() CommitFileOpt
func WithMessage ¶ added in v0.0.5
func WithMessage(msg string) CommitFileOpt
type GitTestRepo ¶ added in v0.0.35
func NewTempRepo ¶
func NewTempRepo(t *testing.T) *GitTestRepo
NewTempRepo initializes a new git repository with reasonable defaults.
func NewTempRepoWithGitHubServer ¶ added in v0.0.36
func NewTempRepoWithGitHubServer(t *testing.T, serverURL string) *GitTestRepo
func (*GitTestRepo) AddFile ¶ added in v0.0.35
func (r *GitTestRepo) AddFile(t *testing.T, fp string)
func (*GitTestRepo) AsAvGitRepo ¶ added in v0.0.35
func (r *GitTestRepo) AsAvGitRepo() *avgit.Repo
func (*GitTestRepo) CheckoutBranch ¶ added in v0.0.35
func (r *GitTestRepo) CheckoutBranch(t *testing.T, branch plumbing.ReferenceName) plumbing.ReferenceName
CheckoutBranch checks out the specified branch and returns the original branch.
func (*GitTestRepo) CheckoutCommit ¶ added in v0.0.35
func (r *GitTestRepo) CheckoutCommit(t *testing.T, hash plumbing.Hash)
func (*GitTestRepo) CommitFile ¶ added in v0.0.35
func (r *GitTestRepo) CommitFile( t *testing.T, filename string, body string, cfOpts ...CommitFileOpt, ) plumbing.Hash
func (*GitTestRepo) CreateFile ¶ added in v0.0.35
func (*GitTestRepo) CreateRef ¶ added in v0.0.35
func (r *GitTestRepo) CreateRef(t *testing.T, ref plumbing.ReferenceName)
func (*GitTestRepo) CurrentBranch ¶ added in v0.0.35
func (r *GitTestRepo) CurrentBranch(t *testing.T) plumbing.ReferenceName
func (*GitTestRepo) GetCommitAtRef ¶ added in v0.0.35
func (r *GitTestRepo) GetCommitAtRef(t *testing.T, name plumbing.ReferenceName) plumbing.Hash
func (*GitTestRepo) GetCommits ¶ added in v0.0.35
func (r *GitTestRepo) GetCommits(t *testing.T, includedFromRef, excludedFromRef plumbing.ReferenceName) []plumbing.Hash
func (*GitTestRepo) Git ¶ added in v0.0.35
func (r *GitTestRepo) Git(t *testing.T, args ...string) string
func (*GitTestRepo) IsWorkdirClean ¶ added in v0.0.35
func (r *GitTestRepo) IsWorkdirClean(t *testing.T) bool
func (*GitTestRepo) MergeBase ¶ added in v0.0.35
func (r *GitTestRepo) MergeBase(t *testing.T, ref1, ref2 plumbing.ReferenceName) []plumbing.Hash
func (*GitTestRepo) OpenDB ¶ added in v0.0.35
func (r *GitTestRepo) OpenDB(t *testing.T) *jsonfiledb.DB
func (*GitTestRepo) WithCheckoutBranch ¶ added in v0.0.35
func (r *GitTestRepo) WithCheckoutBranch(t *testing.T, branch plumbing.ReferenceName, f func())
WithCheckoutBranch runs the given function after checking out the specified branch. It returns to the original branch after the function returns.
Click to show internal directories.
Click to hide internal directories.