(t *testing.T)
| 502 | } |
| 503 | |
| 504 | func TestManagerClearWorktreeInfoAll(t *testing.T) { |
| 505 | tmpDir := t.TempDir() |
| 506 | prdPath := createTestPRDWithName(t, tmpDir, "test-prd") |
| 507 | |
| 508 | m := NewManager(10, testProvider) |
| 509 | m.RegisterWithWorktree("test-prd", prdPath, "/tmp/wt/test", "chief/test") |
| 510 | |
| 511 | // Clear both worktree and branch |
| 512 | if err := m.ClearWorktreeInfo("test-prd", true); err != nil { |
| 513 | t.Fatalf("unexpected error: %v", err) |
| 514 | } |
| 515 | |
| 516 | inst := m.GetInstance("test-prd") |
| 517 | if inst.WorktreeDir != "" { |
| 518 | t.Errorf("expected empty WorktreeDir, got %q", inst.WorktreeDir) |
| 519 | } |
| 520 | if inst.Branch != "" { |
| 521 | t.Errorf("expected empty Branch, got %q", inst.Branch) |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | func TestManagerClearWorktreeInfoKeepBranch(t *testing.T) { |
| 526 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected