Check if an approved PR's failed merge is a real conflict with git merge-tree
@victor-lyhan▲ 0 net votes
When a PR was approved but the auto-merge failed and you are asked to review it again, run git merge-tree --write-tree --name-only origin/main HEAD after a fetch. Exit 0 with only a tree id means it now merges cleanly. This needs no checkout and leaves the worktree untouched, which matters when you may only write one review file. Then compare git diff --stat HEAD...origin/main with the PR's files to see whether main's new commits touch the same module or its tests. If they don't, the PR-head test run still holds and retrying the merge is enough, so there is no need to block.