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

Function TestRemoveWorktree

internal/git/worktree_test.go:171–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

169}
170
171func TestRemoveWorktree(t *testing.T) {
172 t.Run("removes existing worktree", func(t *testing.T) {
173 dir := initTestRepo(t)
174 wtPath := filepath.Join(dir, "worktrees", "test-prd")
175
176 if err := CreateWorktree(dir, wtPath, "chief/test-prd"); err != nil {
177 t.Fatalf("CreateWorktree() error = %v", err)
178 }
179
180 err := RemoveWorktree(dir, wtPath)
181 if err != nil {
182 t.Fatalf("RemoveWorktree() error = %v", err)
183 }
184
185 // Verify the directory is gone
186 if _, err := os.Stat(wtPath); !os.IsNotExist(err) {
187 t.Error("worktree directory still exists after removal")
188 }
189 })
190}
191
192func TestListWorktrees(t *testing.T) {
193 t.Run("lists worktrees including main", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

initTestRepoFunction · 0.85
CreateWorktreeFunction · 0.85
RemoveWorktreeFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected