diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-04-02 19:16:28 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-04-15 08:36:03 +0200 |
commit | 120dd1530ae329199928c3494ea6063d741fc54d (patch) | |
tree | a983a4f448d80988e10abe67c6e807ba5f053f7a /pkg/gui | |
parent | 860a8d102b7eac47aaefc3ae17b443e93cd10c9f (diff) |
Make EditRebaseTodo more robust
It used to work on the assumption that rebasing commits in lazygit's model
correspond one-to-one to lines in the git-rebase-todo file, which isn't
necessarily true (e.g. when users use "git rebase --edit-todo" at the custom
command prompt and add a "break" between lines).
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/controllers/local_commits_controller.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/gui/controllers/local_commits_controller.go b/pkg/gui/controllers/local_commits_controller.go index 7afb7e0ed..72169a5f0 100644 --- a/pkg/gui/controllers/local_commits_controller.go +++ b/pkg/gui/controllers/local_commits_controller.go @@ -354,9 +354,7 @@ func (self *LocalCommitsController) handleMidRebaseCommand(action todo.TodoComma false, ) - if err := self.git.Rebase.EditRebaseTodo( - self.context().GetSelectedLineIdx(), action, - ); err != nil { + if err := self.git.Rebase.EditRebaseTodo(commit, action); err != nil { return false, self.c.Error(err) } |