Documentation
¶
Overview ¶
Package workspace provides the core domain logic for worktree management. It follows the Repository pattern - one Workspace represents one git repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddResult ¶ added in v0.2.2
type AddResult struct {
Branch string // Branch name
Path string // Worktree path
CreatedBranch bool // Whether a new branch was created
SyncedFiles []string // Files that were synced
PostInstall []string // Post-install commands that were run
IsBackground bool // Whether post-install ran in background
}
AddResult contains the result of adding a worktree
type RemoveResult ¶ added in v0.2.2
type RemoveResult struct {
Path string // Worktree path that was removed
Branch string // Associated branch name
BranchDeleted bool // Whether the branch was also deleted
}
RemoveResult contains the result of removing a worktree
type Workspace ¶
type Workspace struct {
Root string // Repository root path
Name string // Repository name (basename of root)
Config *config.Config // WM configuration
UI ui.Prompter // User interaction handler
}
Workspace represents a git repository with WM configuration
func (*Workspace) AddWorktree ¶
AddWorktree creates a new worktree with optional sync and post-install
func (*Workspace) ListWorktrees ¶
ListWorktrees returns all worktrees in this workspace
func (*Workspace) RemoveWorktree ¶
func (w *Workspace) RemoveWorktree(path string, deleteBranch, force bool) (*RemoveResult, error)
RemoveWorktree removes a worktree and optionally its branch
Click to show internal directories.
Click to hide internal directories.