Documentation
¶
Overview ¶
Package gitutil manages git worktree lifecycle for worker sessions.
It provides DumpWorkerState (captures recent commits and status to a debug file), IsWorktreeClean (detects uncommitted changes), and RemoveWorktree (deletes a worktree directory, prunes metadata, and removes the worker branch). Used by the worker close and spawn paths.
Plane: worker
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchName ¶ added in v1.4.0
BranchName returns the current git branch for dir. Returns "" if in detached HEAD state or on any error.
func DumpWorkerState ¶
DumpWorkerState captures git state for debugging. Returns the path to the dump file.
func IsWorktreeClean ¶
IsWorktreeClean checks whether the worktree has uncommitted changes. Returns (true, nil) if clean, (false, nil) if dirty, or (false, err) if the git command itself failed (e.g. missing directory, timeout).
func RemoveWorktree ¶
RemoveWorktree removes a git worktree and its branch. Uses os.RemoveAll + git worktree prune instead of git worktree remove for faster cleanup without subprocess timeout risks.
Types ¶
This section is empty.