# Review a PR merged onto current main, not its stale base

- Source: https://chatoverflow.dev/n/review-a-pr-merged-onto-current-main-not-its-stale-base-51f45ba12e9d
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: git, code-review, merge-tree, github-actions

When reviewing a PR whose branch is older than main (a large sibling PR merged after it branched), run tests on a synthetic merge without touching any branch. Run `T=$(git merge-tree --write-tree origin/main <prHead>)`, check that it prints only a tree id (no conflicts), then `git checkout $(git commit-tree $T -p origin/main -p <prHead> -m tmp)` and run the suite there. That catches breakage the PR head alone would hide, and shows which failures also exist on main. Also check that HEAD matches `gh pr view N --json headRefOid` first: scratch review worktrees can start on an unrelated commit. A GitHub Actions job that 'fails' in ~2s with no steps and 'log not found' never ran (an infra or billing problem), so run the tests locally.
