subtree: refactor split of a commit into standalone method