Versions in this module Expand all Collapse all v0 v0.8.1 May 21, 2026 Changes in this version + func InWorktree(ctx context.Context, workdir string) (bool, error) type Trailer + func ParseTrailers(out string) []Trailer + type Worktree struct + Branch string + HeadSHA string + Path string + func ListWorktrees(ctx context.Context, workdir string) ([]Worktree, error) v0.8.0 May 11, 2026 Changes in this version + func RenamesFromRef(ctx context.Context, workdir, ref string) (map[string]string, error) v0.7.0 May 10, 2026 Changes in this version + const TrailerActor + const TrailerAuditOnly + const TrailerAuthorizedBy + const TrailerEntity + const TrailerForce + const TrailerOnBehalfOf + const TrailerPrincipal + const TrailerPriorEntity + const TrailerPriorParent + const TrailerReason + const TrailerScope + const TrailerScopeEnds + const TrailerTests + const TrailerTo + const TrailerVerb + var ErrRefNotFound = errors.New("ref not found") + func Add(ctx context.Context, workdir string, paths ...string) error + func AddCommitSHA(ctx context.Context, workdir, relPath string) (string, error) + func Commit(ctx context.Context, workdir, subject, body string, trailers []Trailer) error + func CommitAllowEmpty(ctx context.Context, workdir, subject, body string, trailers []Trailer) error + func CommitMessage(subject, body string, trailers []Trailer) string + func FormatTestMetrics(m TestMetrics) string + func GitDir(ctx context.Context, workdir string) (string, error) + func HasAnyRemoteTrackingRefs(ctx context.Context, workdir string) (bool, error) + func HasRef(ctx context.Context, workdir, ref string) (bool, error) + func HasRemotes(ctx context.Context, workdir string) (bool, error) + func HeadBody(ctx context.Context, workdir string) (string, error) + func HeadSubject(ctx context.Context, workdir string) (string, error) + func HooksDir(ctx context.Context, workdir string) (string, error) + func Init(ctx context.Context, workdir string) error + func IsAncestor(ctx context.Context, workdir, commit, ref string) (bool, error) + func IsRepo(ctx context.Context, workdir string) bool + func LsTreePaths(ctx context.Context, workdir, ref string, prefixes ...string) ([]string, error) + func Mv(ctx context.Context, workdir, from, to string) error + func ReadFromHEAD(ctx context.Context, workdir, relPath string) ([]byte, error) + func Restore(ctx context.Context, workdir string, paths ...string) error + func StagedPaths(ctx context.Context, workdir string) ([]string, error) + func StashPop(ctx context.Context, workdir string) error + func StashStaged(ctx context.Context, workdir, message string) error + func ValidateTrailer(key, value string) error + type TestMetrics struct + Fail int + Pass int + Skip int + Total int + func ParseStrictTestMetrics(value string) (TestMetrics, error) + func ParseTestMetrics(value string) (TestMetrics, bool) + func (m TestMetrics) TotalOrDerive() int + type Trailer struct + Key string + Value string + func HeadTrailers(ctx context.Context, workdir string) ([]Trailer, error) + func SortedTrailers(trailers []Trailer) []Trailer