workspace

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 9 Imported by: 0

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 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 Open

func Open(ui ui.Prompter) (*Workspace, error)

Open creates a Workspace from the current directory

func OpenAt

func OpenAt(dir string, prompter ui.Prompter) (*Workspace, error)

OpenAt creates a Workspace from a specific directory

func (*Workspace) AddWorktree

func (w *Workspace) AddWorktree(branch string, customPath string) error

AddWorktree creates a new worktree with optional sync and post-install

func (*Workspace) ListWorktrees

func (w *Workspace) ListWorktrees() ([]git.Worktree, error)

ListWorktrees returns all worktrees in this workspace

func (*Workspace) RemoveWorktree

func (w *Workspace) RemoveWorktree(path string, deleteBranch, force bool) error

RemoveWorktree removes a worktree and optionally its branch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL