Documentation
¶
Overview ¶
Package worktree provides worktree lifecycle management and hooks.
Index ¶
Constants ¶
View Source
const DefaultHookTimeout = 30 * time.Second
DefaultHookTimeout is the default timeout for pre-hook execution.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckoutRequest ¶
type CheckoutRequest struct {
WorkspaceID string
WorkItemID string
Repository string
Branch string
WorkItemTitle string
}
CheckoutRequest describes a requested worktree checkout.
type HookConfig ¶
HookConfig configures a hook's behavior.
type HookRegistry ¶
type HookRegistry struct {
// contains filtered or unexported fields
}
HookRegistry manages pre-checkout hooks.
func NewHookRegistry ¶
func NewHookRegistry() *HookRegistry
NewHookRegistry creates a new empty hook registry.
func (*HookRegistry) Register ¶
func (r *HookRegistry) Register(cfg HookConfig, hook PreHook)
Register adds a pre-hook to the registry. Hooks are called in registration order.
func (*HookRegistry) Run ¶
func (r *HookRegistry) Run(ctx context.Context, req CheckoutRequest) error
Run executes all registered pre-hooks against the given request. Returns the first non-nil error from a hook, or nil if all hooks pass.
Click to show internal directories.
Click to hide internal directories.