summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/local_commits_controller.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-02-18 16:12:41 +0100
committerStefan Haller <stefan@haller-berlin.de>2023-02-19 10:21:01 +0100
commit67b8ef449cf13ad7ac6dc52829331ad9803fefff (patch)
treedeeb8391d1bfcf67d42d6850316dfa7fd4f88542 /pkg/gui/controllers/local_commits_controller.go
parentbb856ad7c6380802e0d621a69428ba155203a233 (diff)
Edit by breaking after current commit
Instead of rebasing from the commit below the current one and then setting the current one to "edit", we rebase from the current one and insert a "break" after it. In most cases the behavior is exactly the same as before, except that the new method also works if the current commit is a merge commit. This is useful if you want to create a new commit at the very beginning of your branch (by editing the last commit before your branch).
Diffstat (limited to 'pkg/gui/controllers/local_commits_controller.go')
-rw-r--r--pkg/gui/controllers/local_commits_controller.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/gui/controllers/local_commits_controller.go b/pkg/gui/controllers/local_commits_controller.go
index 3a9aff86b..a9fe7a190 100644
--- a/pkg/gui/controllers/local_commits_controller.go
+++ b/pkg/gui/controllers/local_commits_controller.go
@@ -298,7 +298,8 @@ func (self *LocalCommitsController) edit(commit *models.Commit) error {
return self.c.WithWaitingStatus(self.c.Tr.RebasingStatus, func() error {
self.c.LogAction(self.c.Tr.Actions.EditCommit)
- return self.interactiveRebase("edit")
+ err := self.git.Rebase.InteractiveRebaseBreakAfter(self.model.Commits, self.context().GetSelectedLineIdx())
+ return self.helpers.MergeAndRebase.CheckMergeOrRebase(err)
})
}