Skip to content

Commit eda65cb

Browse files
committed
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.
1 parent 41a7afb commit eda65cb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pkg/gui/controllers/local_commits_controller.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,16 +409,13 @@ func (self *LocalCommitsController) switchFromCommitMessagePanelToEditor(filepat
409409
}
410410

411411
func (self *LocalCommitsController) handleReword(summary string, description string) error {
412-
var err error
413-
414412
if models.IsHeadCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx()) {
415413
// we've selected the top commit so no rebase is required
416-
err = self.c.Helpers().GPG.WithGpgHandling(self.c.Git().Commit.RewordLastCommit(summary, description),
414+
return self.c.Helpers().GPG.WithGpgHandling(self.c.Git().Commit.RewordLastCommit(summary, description),
417415
self.c.Tr.CommittingStatus, nil)
418-
} else {
419-
err = self.c.Git().Rebase.RewordCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx(), summary, description)
420416
}
421417

418+
err := self.c.Git().Rebase.RewordCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx(), summary, description)
422419
if err != nil {
423420
return err
424421
}

0 commit comments

Comments
 (0)