You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(git): compute worktree ahead/behind via git status instead of rev-list
getWorktreeHealth spawned up to 3 git subprocesses per worktree (rev-parse
for the upstream name, log for last-commit date, and a conditional
rev-list to count ahead/behind). `git status --porcelain=v2 --branch`
reports the upstream name and its ahead/behind counts natively in one
call, cutting the common case down to 2 subprocesses (status + log) — the
rev-list fallback now only runs for the less common no-upstream+baseRef
case, where git's own status can't compute ahead/behind for us.
Motivated by a reproducible Windows-only E2E failure on this branch
(daily-workflow.spec.ts, stash-cherry-pick-workflow.spec.ts) that didn't
reproduce on main or other concurrent PRs at the same point in time: the
extra concurrent git.exe spawns this feature added on every workspace/
worktree-list load were tipping the odds of an existing, separately
tracked directory-deletion race (WORKSPACE_CLOSE waiting for in-flight git
ops, #162) specifically on Windows, where spawning git is markedly slower
than macOS/Linux. A prior attempt to fix this by slowing the poll interval
did not help, since TanStack Query fires the initial fetch immediately on
mount regardless of staleTime/refetchInterval — the actual burst this
targets happens right when worktrees load, not on the steady-state poll.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments