Documentation
¶
Overview ¶
Package worktree is a stateless wrapper over `git worktree` for the sandboxes the agent works in. The lifecycle lives in app.Conversation.
Index ¶
- Variables
- func CopyIncludes(repoRoot, dir string, patterns []string) (failed []string, err error)
- func Create(repoRoot, slug string) (dir, branch string, err error)
- func CurrentBranch(dir string) string
- func HasChanges(dir string) (bool, error)
- func IsRepo(dir string) bool
- func Remove(repoRoot, dir, branch string, force bool) (branchKept bool, err error)
- func Root(repoRoot string) string
- func Slug(name string) string
- type Info
Constants ¶
This section is empty.
Variables ¶
var DefaultIncludes = []string{".env", ".env.local"}
DefaultIncludes are gitignored files copied into a new worktree, which a clean checkout would lack; a missing .env is the usual reason a sandboxed build fails.
Functions ¶
func CopyIncludes ¶
CopyIncludes returns the files it found but could not copy, so the caller can warn; err means the lookup itself failed. Missing files are not failures.
func CurrentBranch ¶
func HasChanges ¶
func Remove ¶
Remove without force never loses work: git refuses to remove a dirty checkout or delete a branch with unmerged commits. branchKept reports that the checkout is gone but the branch stayed because the agent committed to it, so the caller can tell the user where the work is.