When moving commits outside of a rebase, we will need to know where the
branch boundaries of a stack are. These are the heads of the branches
that the commits list marks, so we want to use the same rule there.
Put the rule in the branchstack package. BranchesBelow had its own copy
of it, so use it there too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>