fix(worktree): read the stale-cleanup ledger through its module

#17857 and #17829 landed minutes apart: one moved staleCleanupInFlight into worktree-create-preparation-stale-cleanup.ts, the other added hasPendingWorktreeCreatePreparations reading it by name. main fails tc:node at the merge.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
This commit is contained in:
Jinwoo-H
2026-09-01 22:31:13 -04:00
parent f0ceeb1b0a
commit 65a766beb2
2 changed files with 6 additions and 1 deletions
@@ -74,6 +74,10 @@ export async function cleanupStalePreparations(
}
}
export function hasStaleCleanupInFlight(): boolean {
return staleCleanupInFlight.size > 0
}
export function resetStalePreparationCleanupForTests(): void {
staleCleanupInFlight.clear()
}
+2 -1
View File
@@ -26,6 +26,7 @@ import {
} from './worktree-create-preparation-burst'
import {
cleanupStalePreparations,
hasStaleCleanupInFlight,
resetStalePreparationCleanupForTests
} from './worktree-create-preparation-stale-cleanup'
import { toHostFilesystemPath } from './host-tree-removal'
@@ -63,7 +64,7 @@ const preparations = new Map<string, PreparationEntry>()
/** A prepared checkout is a create that is either in flight or imminent. */
export function hasPendingWorktreeCreatePreparations(): boolean {
return preparations.size > 0 || staleCleanupInFlight.size > 0
return preparations.size > 0 || hasStaleCleanupInFlight()
}
function pathOps(path: string): Pick<typeof posix, 'dirname' | 'join' | 'normalize'> {