jesseduffield / jesseduffield/lazygit

Illegal character U+002D '-'

Open
#2,918 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Describe the bug**
Upon start on existing repository lazygit opens but error is shown "35:2: illegal character U+002D '-'". Then it crashes.

**To Reproduce**
Start lazygit in repository on Windows 10 using cmd.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
![image](https://github.com/jesseduffield/lazygit/assets/7551269/2ba9e688-4725-4b5e-9634-e3a13983e1af)

**Version info:**
commit=5e388e21c8ca6aa883dbcbe45c47f6fdd5116815, build date=2023-08-07T14:05:48Z, build source=binaryRelease, version=0.40.2, os=windows, arch=amd64, git version=2.41.0.windows.1

git version 2.41.0.windows.1

**Additional context**
Cmd contents after crash:

```
POTENTIAL DEADLOCK:
Previous place where the lock was grabbed
goroutine 82 lock 0xc0003803f0
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:452 helpers.(*RefreshHelper).refreshFilesAndSubmodules ??? <<<<<
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:451 helpers.(*RefreshHelper).refreshFilesAndSubmodules ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:139 helpers.(*RefreshHelper).Refresh.func2.5 ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:101 helpers.(*RefreshHelper).Refresh.func2.1.1 ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:679 gocui.(*Gui).onWorkerAux ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:665 gocui.(*Gui).OnWorker.func1 ???

Have been trying to lock it again for more than 30s
goroutine 181 lock 0xc0003803f0
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:452 helpers.(*RefreshHelper).refreshFilesAndSubmodules ??? <<<<<
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:451 helpers.(*RefreshHelper).refreshFilesAndSubmodules ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:139 helpers.(*RefreshHelper).Refresh.func2.5 ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:101 helpers.(*RefreshHelper).Refresh.func2.1.1 ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:679 gocui.(*Gui).onWorkerAux ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:665 gocui.(*Gui).OnWorker.func1 ???

Here is what goroutine 82 doing now
goroutine 82 [semacquire]:
os.stat({0x1568b20, 0x4}, {0xc00d54ed00, 0x32}, 0xc7aba0?)
/opt/hostedtoolcache/go/1.20.7/x64/src/os/stat_windows.go:71 +0x325
os.statNolog(...)
/opt/hostedtoolcache/go/1.20.7/x64/src/os/stat_windows.go:96
os.Stat({0xc00d54ed00, 0x32})
/opt/hostedtoolcache/go/1.20.7/x64/src/os/stat.go:13 +0x45
os/exec.chkStat({0xc00d54ed00?, 0xc000c7aba0?})
/opt/hostedtoolcache/go/1.20.7/x64/src/os/exec/lp_windows.go:20 +0x1e
os/exec.findExecutable({0xc000c7aba0, 0x2e}, {0xc002610000, 0x13, 0x1448500?})
/opt/hostedtoolcache/go/1.20.7/x64/src/os/exec/lp_windows.go:48 +0xdf
os/exec.LookPath({0x15683af, 0x3})
/opt/hostedtoolcache/go/1.20.7/x64/src/os/exec/lp_windows.go:114 +0x4c5
os/exec.Command({0x15683af, 0x3}, {0xc0009fd2d0, 0x4, 0x50?})
/opt/hostedtoolcache/go/1.20.7/x64/src/os/exec/exec.go:419 +0x225
github.com/jesseduffield/lazygit/pkg/commands/oscommands.(*CmdObjBuilder).New(0xc0003882d0, {0xc0009fd2c0?, 0xcbe467?, 0x5?})
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_builder.go:30 +0x5a
github.com/jesseduffield/lazygit/pkg/commands.(*gitCmdObjBuilder).New(0xc000eb2e90?, {0xc0009fd2c0?, 0x5?, 0xc001aa2180?})
/home/runner/work/lazygit/lazygit/pkg/commands/git_cmd_obj_builder.go:34 +0x25
github.com/jesseduffield/lazygit/pkg/commands/git_commands.(*FileLoader).gitStatus(0xc00045e270, {0x14?, {0xc00046c000?, 0x1?}})
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/file_loader.go:111 +0x54f
github.com/jesseduffield/lazygit/pkg/commands/git_commands.(*FileLoader).GetStatusFiles(0xc00045e270, {0x4?})
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/file_loader.go:45 +0xbd
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshStateFiles(0xc00007f880)
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:516 +0x2c9
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshFilesAndSubmodules(0xc00007f880)
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:463 +0x136
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.5()
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:139 +0x26
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.1.1({0x20?, 0x15b8b64?})
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:101 +0x1b
github.com/jesseduffield/gocui.(*Gui).onWorkerAux(0x19?, 0x159dc02?, {0x16b4250?, 0xc00007c780?})
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:678 +0x71
github.com/jesseduffield/gocui.(*Gui).OnWorker.func1()
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:665 +0x31
created by github.com/jesseduffield/gocui.(*Gui).OnWorker
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:664 +0xaa
Other goroutines holding locks:
goroutine 48 lock 0xc000380410
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:302 helpers.(*RefreshHelper).refreshCommitsWithLimit ??? <<<<<
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:301 helpers.(*RefreshHelper).refreshCommitsWithLimit ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:257 helpers.(*RefreshHelper).refreshCommitsAndCommitFiles ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:101 helpers.(*RefreshHelper).Refresh.func2.1.1 ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:679 gocui.(*Gui).onWorkerAux ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:665 gocui.(*Gui).OnWorker.func1 ???

goroutine 49 lock 0xc0003803f8
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:415 helpers.(*RefreshHelper).refreshBranches ??? <<<<<
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:414 helpers.(*RefreshHelper).refreshBranches ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:253 helpers.(*RefreshHelper).refreshReflogAndBranches ???
/home/runner/work/lazygit/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:101 helpers.(*RefreshHelper).Refresh.func2.1.1 ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:679 gocui.(*Gui).onWorkerAux ???
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:665 gocui.(*Gui).OnWorker.func1 ???

POTENTIAL DEADLOCK:

C:\workspace\repo>
```

Debug log
```
Aug 9 15:04:55 |INFO| language: cs-CZ
Aug 9 15:04:55 |DEBU| RunCommand command="git --version"
Aug 9 15:04:56 |INFO| git --version (103.1825ms)
Aug 9 15:04:56 |DEBU| RunCommand command="git rev-parse --git-dir"
Aug 9 15:04:56 |INFO| git rev-parse --git-dir (124.9939ms)
Aug 9 15:04:56 |DEBU| RunCommand command="git rev-parse --is-bare-repository"
Aug 9 15:05:26 |INFO| refreshing all scopes in async mode
Aug 9 15:05:26 |INFO| Refresh took 0s
Aug 9 15:05:26 |ERRO| ignoring create popup panel because a popup panel is already open
Aug 9 15:05:26 |INFO| refreshing all scopes in async mode
Aug 9 15:05:26 |INFO| Refresh took 0s
Aug 9 15:05:26 |ERRO| ignoring create popup panel because a popup panel is already open
Aug 9 15:05:26 |INFO| refreshing all scopes in async mode
Aug 9 15:05:26 |INFO| Refresh took 0s
Aug 9 15:05:26 |ERRO| ignoring create popup panel because a popup panel is already open
Aug 9 15:05:27 |DEBU| RunCommand command="git tag --list -n --sort=-creatordate"
Aug 9 15:05:26 |INFO| refreshing all scopes in async mode
Aug 9 15:05:26 |INFO| Refresh took 0s
Aug 9 15:05:26 |ERRO| ignoring create popup panel because a popup panel is already open
Aug 9 15:05:27 |DEBU| RunCommand command="git tag --list -n --sort=-creatordate"
Aug 9 15:05:28 |INFO| git worktree list --porcelain (28.4922355s)
Aug 9 15:05:28 |INFO| postRefreshUpdate for localBranches took 0s
Aug 9 15:05:28 |INFO| postRefreshUpdate for worktrees took 520.7µs
Aug 9 15:05:28 |DEBU| RunCommand command="git worktree list --porcelain"
Aug 9 15:05:28 |INFO| git -c log.showSignature=false log -g --abbrev=40 --format=%h%x00%ct%x00%gs%x00%p (28.2895345s)
Aug 9 15:05:28 |INFO| postRefreshUpdate for reflogCommits took 14.779ms
Aug 9 15:05:32 |DEBU| RunCommand command="git worktree list --porcelain"
Aug 9 15:05:32 |DEBU| RunCommand command="git tag --list -n --sort=-creatordate"
Aug 9 15:05:32 |DEBU| RunCommand command="git tag --list -n --sort=-creatordate"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.