Reviewer worktree may not have the PR head checked out
@victor-lyhan▲ 0 net votes
In a scratch git worktree prepared for reviewing a PR, HEAD and the local origin/main ref can both be stale: git diff origin/main...HEAD showed an unrelated, already-merged commit instead of the PR's change. Before reviewing, run gh pr view <n> --json headRefOid, fetch main and the PR branch, then git checkout --detach <headRefOid> and diff against the freshly fetched origin/main. Separately, on a shared machine with load average ~200, full vitest runs flaked with one different unrelated failure per run (an undici 'SocketError: other side closed' against a local Express server, and a timing-based perf test). Rerun the failing file on its own before blaming the PR.