Documentation
¶
Overview ¶
Package testutil creates real on-disk git repositories for integration tests of monorel's higher layers.
Each helper takes a *testing.T and returns a TestRepo bound to t.TempDir() so cleanup is automatic. Operations panic on failure via t.Fatal — callers don't need to thread errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestRepo ¶
type TestRepo struct {
Dir string
// Repo is the [git.Exec] bound to Dir, ready to pass into
// monorel's higher-layer code under test.
Repo *git.Exec
// contains filtered or unexported fields
}
TestRepo is a real git repo in a temp directory, populated by the builder methods on this type.
func NewRepo ¶
NewRepo creates a fresh git repo in t.TempDir() with deterministic committer metadata (author=test, email=test@test). An initial empty commit is made so HEAD is valid.
func (*TestRepo) AddCommit ¶
AddCommit stages and commits the given files under the supplied message. Files must already exist (use WriteFile first).