jesseduffield / lazygit

simple terminal UI for git commands
MIT License
47.94k stars 1.72k forks source link

SIGSEGV github.com/jesseduffield/lazygit/pkg/commands/models.(*RemoteBranch).FullName(0xc0009afc20?) #3661

Open jorgheymans opened 2 weeks ago

jorgheymans commented 2 weeks ago

In my terminal, i did git checkout main && git pull --prune origin on the repository that lazygit was open at in another terminal and it crashed. There were about 20 branches pruned in the pull, maybe this is what caused the problem ? Unsure how to correctly title this issue, feel free to change it.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x7fe4ae]

goroutine 473546 [running]:
github.com/jesseduffield/lazygit/pkg/commands/models.(*RemoteBranch).FullName(0xc0009afc20?)
    /home/runner/work/lazygit/lazygit/pkg/commands/models/remote_branch.go:10 +0xe
github.com/jesseduffield/lazygit/pkg/gui/context.NewRemoteBranchesContext.func3.GetRemoteBranchListDisplayStrings.1(0x0, 0xc000c32740?)
    /home/runner/work/lazygit/lazygit/pkg/gui/presentation/remote_branches.go:12 +0x2a
github.com/samber/lo.Map[...]({0xc000e35590?, 0x2, 0xe5c2a0}, 0xc0009afcb8?)
    /home/runner/work/lazygit/lazygit/vendor/github.com/samber/lo/slice.go:29 +0x74
github.com/jesseduffield/lazygit/pkg/gui/presentation.GetRemoteBranchListDisplayStrings(...)
    /home/runner/work/lazygit/lazygit/pkg/gui/presentation/remote_branches.go:11
github.com/jesseduffield/lazygit/pkg/gui/context.NewRemoteBranchesContext.func3(0x0?, 0x0?)
    /home/runner/work/lazygit/lazygit/pkg/gui/context/remote_branches_context.go:32 +0xa5
github.com/jesseduffield/lazygit/pkg/gui/context.(*ListRenderer).renderLines(0xc0002a1790, 0xffffffffffffffff, 0xffffffffffffffff)
    /home/runner/work/lazygit/lazygit/pkg/gui/context/list_renderer.go:88 +0x1b1
github.com/jesseduffield/lazygit/pkg/gui/context.(*ListContextTrait).HandleRender(0xc0002a1780)
    /home/runner/work/lazygit/lazygit/pkg/gui/context/list_context_trait.go:96 +0x45
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).postRefreshUpdate(0xc00029a608, {0xe627a8, 0xc000018408})
    /home/runner/work/lazygit/lazygit/pkg/gui/view_helpers.go:140 +0xc7
github.com/jesseduffield/lazygit/pkg/gui.(*guiCommon).PostRefreshUpdate(0xc0008023d0?, {0xe627a8?, 0xc000018408?})
    /home/runner/work/lazygit/lazygit/pkg/gui/gui_common.go:33 +0x25
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshView(0xc0008a2580, {0xe627a8, 0xc000018408})
    /home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:736 +0x4c
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshRemotes(0xc0008a2580)
    /home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:661 +0x19f
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.9()
    /home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:164 +0x17
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.1.1({0x0?, 0x25?})
    /home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:108 +0x13
github.com/jesseduffield/gocui.(*Gui).onWorkerAux(0xc0002c4700, 0x44695d?, {0xe54e38?, 0xc00032ac80?})
    /home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:682 +0x6b
github.com/jesseduffield/gocui.(*Gui).OnWorker.func1()
    /home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:669 +0x2b
created by github.com/jesseduffield/gocui.(*Gui).OnWorker in goroutine 1
    /home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:668 +0x92