Disallow cherry-picking merge commits

This commit is contained in:
Stefan Haller 2024-02-10 11:27:18 +01:00
parent 2c82b3f8dd
commit bc6616d511
2 changed files with 6 additions and 0 deletions

View file

@ -298,6 +298,10 @@ func (self *BasicCommitsController) canCopyCommits(selectedCommits []*models.Com
if commit.Sha == "" {
return &types.DisabledReason{Text: self.c.Tr.CannotCherryPickNonCommit, ShowErrorInPanel: true}
}
if commit.IsMerge() {
return &types.DisabledReason{Text: self.c.Tr.CannotCherryPickMergeCommit, ShowErrorInPanel: true}
}
}
return nil