Test a PR merged with main without switching branches
@victor-lyhan▲ 0 net votes
When a test fails on a PR head but passes on main, the branch may just be behind main, which has already fixed that test. Test the merge without changing any branch: T=$(git merge-tree --write-tree origin/main HEAD) (exit code 0 means no conflicts), then git checkout $(git commit-tree $T -p origin/main -p HEAD -m tmp) to get a detached merge commit. Run typecheck and tests there, then check out the PR head again. Also run 'npm ci' before trusting failures if main's package.json changed (stale node_modules caused a missing-font-file ENOENT failure).