jesseduffield / jesseduffield/lazygit
Crash on refresh
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
I pressed crtl+r in the submodules panel to force a refresh. This resulted in
```
panic: exit status 1
goroutine 4223 [running]:
github.com/jesseduffield/lazygit/pkg/commands/git_commands.(*BranchLoader).obtainBranches(0xc000895d88?)
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/branch_loader.go:119 +0x85
github.com/jesseduffield/lazygit/pkg/commands/git_commands.(*BranchLoader).Load(0xc000600810, {0xc0006a2000, 0x23, 0x24})
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/branch_loader.go:60 +0x4e
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshBranches(0xc0003c0000)
/home/runner/work/lazygit/lazygit/pkg/gui/refresh.go:312 +0x105
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshCommits.func1()
/home/runner/work/lazygit/lazygit/pkg/gui/refresh.go:196 +0x35
github.com/jesseduffield/lazygit/pkg/utils.Safe.func1()
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:108 +0x1b
github.com/jesseduffield/lazygit/pkg/utils.SafeWithError(0x1020285?)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:119 +0x67
github.com/jesseduffield/lazygit/pkg/utils.Safe(0x0?)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:108 +0x35
created by github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshCommits
/home/runner/work/lazygit/lazygit/pkg/gui/refresh.go:193 +0xca
```
I'm suspecting it is timing issue as Lazygit appeared to be refreshing itself just at the moment I forced it to
**To Reproduce**
There seems to be no easy way, but force spamming shift+r on a big (read slow) repository seems to do the trick
**Expected behavior**
Refresh Lazygit withoud crashing
**Version info:**
lazygit: commit=5149b24ab3dfad3860e2300519c7c583dcc8c9ff, build date=2023-05-03T08:00:22Z, build source=binaryRelease, version=0.38.2, os=windows, arch=amd64, git version=2.40.1.windows.1
git: git version 2.40.1.windows.1
**Additional context**
The repository I did this on is old, big and slow. It appears that the speed of the `git status` is related to this crash. I was not able to reproduce this on a new/small repository
Contributor guide
Assessment
This issue has not been assessed yet.