Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPatch ¶
ApplyPatch applies a patch to a repository. Returns nil if patch is empty.
func CheckPatch ¶
CheckPatch does a dry-run apply to check if a patch applies cleanly. Returns a *PatchConflictError when the patch fails due to conflicts, or a plain error for other failures (malformed patch, etc.).
Types ¶
type PatchConflictError ¶
type PatchConflictError struct {
Detail string
}
PatchConflictError indicates the patch does not apply due to merge conflicts. Other errors (malformed patch, permission errors) are returned as plain errors.
func (*PatchConflictError) Error ¶
func (e *PatchConflictError) Error() string
type Worktree ¶
type Worktree struct {
Dir string // Path to the worktree directory
// contains filtered or unexported fields
}
Worktree represents a temporary git worktree for isolated agent work. Call Close to remove the worktree and its directory.
func Create ¶
Create creates a temporary git worktree detached at the given ref for isolated agent work. Pass "HEAD" for the current checkout.
func (*Worktree) CapturePatch ¶
CapturePatch stages all changes in the worktree and returns the diff as a patch string. Returns empty string if there are no changes. Handles both uncommitted and committed changes by diffing the final tree state against the base SHA.