Review report

core: PR #35686

🟡 Minor

Select the merge that introduced the squash (test/lint/git-subtree-check.sh:138, head)

git rev-list lists commits in reverse chronological order by default, so tail -1 selects the oldest qualifying merge, not necessarily the one that introduced $old. If the ancestry path contains multiple merges, the script may check an unrelated merge and incorrectly accept or reject the subtree update. Identify the merge structurally, for example by checking which candidate carries the relevant subtree metadata or has the relevant second parent.

Compare the subtree merge's first parent (test/lint/git-subtree-check.sh:145, head)

The stated stacking condition is that the subtree merge's first parent is the previous subtree merge. But merge^1^2 refers to the first parent's second parent, so this checks the wrong commit. Compare the resolved merge^1 directly with prev_squash to enforce the documented condition.