Expand description
Git worktree management for Brat polecat sessions.
This crate provides a WorktreeManager for creating, tracking, and
cleaning up git worktrees. Each polecat session runs in an isolated
worktree to enable parallel work without conflicts.
§Example
ⓘ
use libbrat_worktree::WorktreeManager;
let manager = WorktreeManager::new("/path/to/repo", ".grite/worktrees", 6);
// Create a worktree for a session
let path = manager.create("s-20250117-a2f9")?;
// List managed worktrees
let worktrees = manager.list()?;
// Remove a worktree
manager.remove("s-20250117-a2f9")?;Structs§
- Cleanup
Report - Report from cleanup operation.
- Worktree
Entry - Raw entry from
git worktree list --porcelain. - Worktree
Info - Information about a managed worktree.
- Worktree
Manager - Manages git worktrees for polecat sessions.
Enums§
- Worktree
Error - Error type for worktree operations.