MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / UpdateWorktreeInfo

Method UpdateWorktreeInfo

internal/loop/manager.go:391–407  ·  view source on GitHub ↗

UpdateWorktreeInfo updates the worktree directory and branch for an existing PRD instance.

(name, worktreeDir, branch string)

Source from the content-addressed store, hash-verified

389
390// UpdateWorktreeInfo updates the worktree directory and branch for an existing PRD instance.
391func (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.
410func (m *Manager) ClearWorktreeInfo(name string, clearBranch bool) error {

Calls

no outgoing calls