You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I try to do Patch Options such as "Move patch into new commit with nothing selected in Custom Patch I get a crash.
To Reproduce
Steps to reproduce the behavior:
This will occur in any repo:
enter lazygit
go to Commits view
enter patch view for some file (enter, enter)
Control-P to "View custom patch options"
select something like i "Move patch into new commit"
observe crash:
Expected behavior
If you repeat these steps at the commit view instead of patch view, you get an error (without crashing): No patch created yet. To start building a patch, use 'space' on a commit file or enter to add specific lines. Something like this would be useful.
Screenshots
panic: runtime error: index out of range [-1]
goroutine 157 [running]:
github.com/jesseduffield/lazygit/pkg/commands/git_commands.(*RebaseCommands).BeginInteractiveRebaseForCommit(0x14000150300, {0x14000324280, 0x4, 0x140001128f0?}, 0xffffffffffffffff, 0x0)
github.com/jesseduffield/lazygit/pkg/commands/git_commands/rebase.go:292 +0x278
github.com/jesseduffield/lazygit/pkg/commands/git_commands.(*PatchCommands).MovePatchIntoIndex(0x140002fe330, {0x14000324280?, 0x4, 0x10546a9ac?}, 0xffffffffffffffff, 0x0)
github.com/jesseduffield/lazygit/pkg/commands/git_commands/patch.go:228 +0xcc
github.com/jesseduffield/lazygit/pkg/gui/controllers.(*CustomPatchOptionsMenuAction).handleMovePatchIntoWorkingTree.func1.1({0x14000030550, 0x14000068900})
github.com/jesseduffield/lazygit/pkg/gui/controllers/custom_patch_options_menu_action.go:159 +0xe0
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*AppStatusHelper).WithWaitingStatus.func1.1()
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/app_status_helper.go:35 +0x54
github.com/jesseduffield/lazygit/pkg/gui/status.(*StatusManager).WithWaitingStatus(0x1400038e330, {0x105522c4d, 0x8}, 0x140003eaf20)
github.com/jesseduffield/lazygit/pkg/gui/status/status_manager.go:44 +0x1d8
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*AppStatusHelper).WithWaitingStatus.func1({0x1057e4f70, 0x14000324820})
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/app_status_helper.go:32 +0x94
github.com/jesseduffield/gocui.(*Gui).onWorkerAux(0x0?, 0x0?, {0x1057e4f70?, 0x14000324820?})
github.com/jesseduffield/gocui@v0.3.1-0.20230723014157-03e858e46144/gui.go:673 +0x6c
github.com/jesseduffield/gocui.(*Gui).OnWorker.func1()
github.com/jesseduffield/gocui@v0.3.1-0.20230723014157-03e858e46144/gui.go:660 +0x34
created by github.com/jesseduffield/gocui.(*Gui).OnWorker
github.com/jesseduffield/gocui@v0.3.1-0.20230723014157-03e858e46144/gui.go:659 +0x9c
Version info: commit=, build date=, build source=homebrew, version=0.39.4, os=darwin, arch=arm64, git version=2.39.2 (Apple Git-143) git version 2.39.2 (Apple Git-143)
Additional context
N/A
Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.
The text was updated successfully, but these errors were encountered:
It's not a regression, it always crashed in this way. The issue is that CustomPatchOptionsMenuAction.Call only checks whether PatchBuilder.Active() is false; but it's true when you are in the patch building view. We also need to check IsEmpty in this case. See #2829 for a fix.
Describe the bug
When I try to do Patch Options such as "Move patch into new commit with nothing selected in Custom Patch I get a crash.
To Reproduce
Steps to reproduce the behavior:
This will occur in any repo:
i
"Move patch into new commit"Expected behavior
If you repeat these steps at the commit view instead of patch view, you get an error (without crashing):
No patch created yet. To start building a patch, use 'space' on a commit file or enter to add specific lines
. Something like this would be useful.Screenshots
Version info:
commit=, build date=, build source=homebrew, version=0.39.4, os=darwin, arch=arm64, git version=2.39.2 (Apple Git-143)
git version 2.39.2 (Apple Git-143)
Additional context
N/A
Note: please try updating to the latest version or manually building the latest
master
to see if the issue still occurs.The text was updated successfully, but these errors were encountered: