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

Method ClearWorktreeInfo

internal/loop/manager.go:410–428  ·  view source on GitHub ↗

ClearWorktreeInfo clears the worktree directory and optionally the branch for a PRD instance.

(name string, clearBranch bool)

Source from the content-addressed store, hash-verified

408
409// ClearWorktreeInfo clears the worktree directory and optionally the branch for a PRD instance.
410func (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.
431func (m *Manager) GetState(name string) (LoopState, int, error) {

Calls

no outgoing calls