Documentation
¶
Overview ¶
Package worktrees implements the worktree management panel for grut. It displays all git worktrees with path, branch, and hash information, supports create, remove, and switch operations, and detects external deletion of worktree directories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitOps ¶
type GitOps interface {
WorktreeList(ctx context.Context) ([]git.Worktree, error)
WorktreeAdd(ctx context.Context, path, branch string) error
WorktreeRemove(ctx context.Context, path string, force bool) error
}
GitOps defines the git operations required by the worktree panel. This narrow interface is satisfied by *git.Client and makes the panel easy to mock in tests.
type Panel ¶
--------------------------------------------------------------------------- Panel --------------------------------------------------------------------------- Panel is the worktree management panel. It implements panels.Panel.
func (*Panel) Init ¶
--------------------------------------------------------------------------- panels.Panel interface --------------------------------------------------------------------------- Init implements panels.Panel.
func (*Panel) KeyBindings ¶
func (p *Panel) KeyBindings() []panels.KeyBinding
KeyBindings implements panels.Panel.
func (*Panel) SetActionsCfg ¶
func (p *Panel) SetActionsCfg(cfg config.ActionsConfig)
SetActionsCfg injects the actions configuration for right-click menus.
type PathChecker ¶
PathChecker abstracts filesystem existence checks for testability. The default implementation uses os.Stat.