UpdateWorktreeInfo updates the worktree directory and branch for an existing PRD instance.
(name, worktreeDir, branch string)
| 389 | |
| 390 | // UpdateWorktreeInfo updates the worktree directory and branch for an existing PRD instance. |
| 391 | func (m *Manager) UpdateWorktreeInfo(name, worktreeDir, branch string) error { |
| 392 | m.mu.RLock() |
| 393 | instance, exists := m.instances[name] |
| 394 | m.mu.RUnlock() |
| 395 | |
| 396 | if !exists { |
| 397 | return fmt.Errorf("PRD %s not found", name) |
| 398 | } |
| 399 | |
| 400 | instance.mu.Lock() |
| 401 | defer instance.mu.Unlock() |
| 402 | |
| 403 | instance.WorktreeDir = worktreeDir |
| 404 | instance.Branch = branch |
| 405 | |
| 406 | return nil |
| 407 | } |
| 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 { |
no outgoing calls