Kind: Class
Source: atloria-monorepo/libs/agent-core/src/tools/worktree-manager.ts
Methods
| Method | Signature | Returns |
|---|---|---|
isGitRepo | isGitRepo() | boolean |
create | create(name: string) | WorktreeInfo |
remove | remove(name: string) | void |
list | list() | WorktreeInfo[] |
diff | diff(name: string) | string |
hasChanges | hasChanges(name: string) | boolean |
activeCount | activeCount() | number |
pruneStale | pruneStale() | number |
Where it refuses work
WorktreeManagerstops the work withErrorwhen!this.isGitRepo()— “WorktreeManager: not a git repository”.WorktreeManagerstops the work withErrorwhenthis.activeCount() >= this.maxWorktrees.WorktreeManagerstops the work with an early return when!branch, in 2 places.WorktreeManagerstops the work with an early return whenthis.branchExists(expected).WorktreeManagerstops the work with an early return whenlines.length > 0 && lines[0].WorktreeManagerstops the work with an early return whenthis.branchExists('main').
When something fails
WorktreeManagerhandles failure in 12 places: it turns it into a return value in 6, discards it silently in 4, and logs it and continues in 2. A failure discarded silently leaves no trace for whoever debugs this later.
Was this page helpful?