mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-19 12:12:42 +02:00
Avoid double Refresh when rewording the head commit
WithGpgHandling already does an async refresh when done, so there's no need to do one here for the case of amending the head commit. On top of that, WithGpgHandling uses WithWaitingStatus and works in the background, so the Refresh here would come too early anyway.
This commit is contained in:
parent
41a7afb105
commit
eda65cbade
@ -409,16 +409,13 @@ func (self *LocalCommitsController) switchFromCommitMessagePanelToEditor(filepat
|
||||
}
|
||||
|
||||
func (self *LocalCommitsController) handleReword(summary string, description string) error {
|
||||
var err error
|
||||
|
||||
if models.IsHeadCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx()) {
|
||||
// we've selected the top commit so no rebase is required
|
||||
err = self.c.Helpers().GPG.WithGpgHandling(self.c.Git().Commit.RewordLastCommit(summary, description),
|
||||
return self.c.Helpers().GPG.WithGpgHandling(self.c.Git().Commit.RewordLastCommit(summary, description),
|
||||
self.c.Tr.CommittingStatus, nil)
|
||||
} else {
|
||||
err = self.c.Git().Rebase.RewordCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx(), summary, description)
|
||||
}
|
||||
|
||||
err := self.c.Git().Rebase.RewordCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx(), summary, description)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user