Allow rewording for last commit using GPG

This commit is contained in:
Neko Box Coder 2024-08-10 13:25:35 +01:00 committed by Stefan Haller
parent ce6388bdfa
commit 4a2508e960
4 changed files with 14 additions and 10 deletions

View file

@ -39,18 +39,13 @@ func (self *RebaseCommands) RewordCommit(commits []*models.Commit, index int, su
return errors.New(self.Tr.DisabledForGPG)
}
if models.IsHeadCommit(commits, index) {
// we've selected the top commit so no rebase is required
return self.commit.RewordLastCommit(summary, description)
}
err := self.BeginInteractiveRebaseForCommit(commits, index, false)
if err != nil {
return err
}
// now the selected commit should be our head so we'll amend it with the new message
err = self.commit.RewordLastCommit(summary, description)
err = self.commit.RewordLastCommit(summary, description).Run()
if err != nil {
return err
}