ClearWorktreeInfo clears the worktree directory and optionally the branch for a PRD instance.
(name string, clearBranch bool)
| 408 | |
| 409 | // ClearWorktreeInfo clears the worktree directory and optionally the branch for a PRD instance. |
| 410 | func (m *Manager) ClearWorktreeInfo(name string, clearBranch bool) error { |
| 411 | m.mu.RLock() |
| 412 | instance, exists := m.instances[name] |
| 413 | m.mu.RUnlock() |
| 414 | |
| 415 | if !exists { |
| 416 | return fmt.Errorf("PRD %s not found", name) |
| 417 | } |
| 418 | |
| 419 | instance.mu.Lock() |
| 420 | defer instance.mu.Unlock() |
| 421 | |
| 422 | instance.WorktreeDir = "" |
| 423 | if clearBranch { |
| 424 | instance.Branch = "" |
| 425 | } |
| 426 | |
| 427 | return nil |
| 428 | } |
| 429 | |
| 430 | // GetState returns the state of a specific PRD loop. |
| 431 | func (m *Manager) GetState(name string) (LoopState, int, error) { |
no outgoing calls