MCPcopy Index your code
hub / github.com/garrytan/gstack / cleanupAll

Method cleanupAll

lib/worktree.ts:233–246  ·  view source on GitHub ↗

Force-remove all active worktrees (for process exit handler).

()

Source from the content-addressed store, hash-verified

231
232 /** Force-remove all active worktrees (for process exit handler). */
233 cleanupAll(): void {
234 for (const testName of [...this.active.keys()]) {
235 this.cleanup(testName);
236 }
237
238 // Clean up the run directory if empty
239 const runDir = path.join(this.repoRoot, '.gstack-worktrees', this.runId);
240 try {
241 const entries = fs.readdirSync(runDir);
242 if (entries.length === 0) {
243 fs.rmdirSync(runDir);
244 }
245 } catch { /* non-fatal */ }
246 }
247
248 /** Remove worktrees from previous runs that weren't cleaned up. */
249 pruneStale(): void {

Callers 1

constructorMethod · 0.95

Calls 1

cleanupMethod · 0.95

Tested by

no test coverage detected