Properly handle merge commits in the export/cherry-pick guis