From 37c671b4c0bc295b55bc53864a1041b17ff749b3 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 26 Feb 2024 20:32:56 +0100 Subject: [PATCH] Fix showing old-style non-interactive rebase todo When doing a non-interactive rebase using a version of git earlier than 2.26, or by explicitly calling `git -c rebase.backend=apply rebase`, lazygit can display the pending todos by parsing the numbered patch files in `.git/rebase-apply/`. Unfortunately, support for this has been broken for more than three years because of the change in 682db77401e (the string literal "normal" should have been changed to REBASE_MODE_NORMAL instead of REBASE_MODE_MERGING). It's not an important bug since you can only get into this situation by doing a rebase outside of lazygit, and then only with a pretty old git version. So instead of fixing the bug we might consider removing this code. --- pkg/commands/git_commands/commit_loader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/git_commands/commit_loader.go b/pkg/commands/git_commands/commit_loader.go index 2acde9da5..cc4eefe1c 100644 --- a/pkg/commands/git_commands/commit_loader.go +++ b/pkg/commands/git_commands/commit_loader.go @@ -316,7 +316,7 @@ func (self *CommitLoader) getHydratedRebasingCommits(rebaseMode enums.RebaseMode // getRebasingCommits obtains the commits that we're in the process of rebasing func (self *CommitLoader) getRebasingCommits(rebaseMode enums.RebaseMode) ([]*models.Commit, error) { switch rebaseMode { - case enums.REBASE_MODE_MERGING: + case enums.REBASE_MODE_NORMAL: return self.getNormalRebasingCommits() case enums.REBASE_MODE_INTERACTIVE: return self.getInteractiveRebasingCommits()