OTOH, I see the code you are removing from `pull rebase` is much smaller than what you are adding, and the closed state chage is duplicated and breaks the option in pull rebase to rebase an already closed pull request, so I'm not convinced the best approach is to unify this code (also, I would suggest allowing checking out a closed pull request, is basically harmless).