jesseduffield / jesseduffield/lazygit
Panic when loading branches on windows
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
Panic occurs when loading branches:
panic: '%' is not recognized as an internal or external command, operable program or batch file.
goroutine 39 [running]:
github.com/jesseduffield/lazygit/pkg/commands.(*BranchListBuilder).obtainBranches(0xc00039bef0, 0x1367340, 0x10000, 0x0)
/home/runner/work/lazygit/lazygit/pkg/commands/loading_branches.go:43 +0x693
github.com/jesseduffield/lazygit/pkg/commands.(*BranchListBuilder).Build(0xc0000dbef0, 0x11315f7, 0xc0000a4690, 0x1326e87)
/home/runner/work/lazygit/lazygit/pkg/commands/loading_branches.go:103 +0x52
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshBranches(0xc0000b8000)
/home/runner/work/lazygit/lazygit/pkg/gui/branches_panel.go:69 +0xc6
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshReflogCommitsConsideringStartup.func1()
/home/runner/work/lazygit/lazygit/pkg/gui/commits_panel.go:69 +0x45
github.com/jesseduffield/lazygit/pkg/utils.Safe.func1(0xb35af5, 0xc000055da0)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:95 +0x2b
github.com/jesseduffield/lazygit/pkg/utils.SafeWithError(0xc00039bfb8, 0x0, 0x0)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:106 +0x67
github.com/jesseduffield/lazygit/pkg/utils.Safe(0xc00008aa40)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:95 +0x50
created by github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshReflogCommitsConsideringStartup
/home/runner/work/lazygit/lazygit/pkg/gui/commits_panel.go:67 +0xa9
**To Reproduce**
Open lazygit in Windows 10 Pro-64 bit (Version 10.0.19043.1387), cmd or ConEmu
**Expected behavior**
no panic
**Desktop (please complete the following information):**
- OS: Windows
- Lazygit Version: presumably latest
**Additional context**
I suspect we just need to escape those quote symbols so that windows doesn't think it's dealing with a new command. Interesting that this isn't caught by our windows integration tests given that whenever we open lazygit, the branches load.
Contributor guide
Assessment
This issue has not been assessed yet.