jesseduffield / jesseduffield/lazygit
can't use lazygit in .git (gitdir) repo
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
lazygit report error
*errors.errorString Error getting repo paths: failed to get repo git dir path: could not find git dir for` /Users/xxx/Library/Mobile Documents/iCloud~com~logseq~logseq/Documents/n`: path is not under `worktrees` or `modules` directories
**To Reproduce**
1. Go to a git folder, which doesn't have .git folder. it has .git file(`gitdir: to a git folder` instead
2. Run lazygit
3. error
```
*errors.errorString Error getting repo paths: failed to get repo git dir path: could not find git dir for` /Users/xxx/Library/Mobile Documents/iCloud~com~logseq~logseq/Documents/n`: path is not under `worktrees` or `modules` directories
github.com/jesseduffield/lazygit/pkg/commands/git.go:100 (0x10480d2b8)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:271 (0x10492f190)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:656 (0x104931b94)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:675 (0x1049320b0)
github.com/jesseduffield/lazygit/pkg/utils/utils.go:108 (0x10469c950)
github.com/jesseduffield/lazygit/pkg/gui/gui.go:674 (0x10493201c)
github.com/jesseduffield/lazygit/pkg/app/app.go:263 (0x104958ccc)
github.com/jesseduffield/lazygit/pkg/app/app.go:48 (0x104958c91)
github.com/jesseduffield/lazygit/pkg/app/entry_point.go:150 (0x10495a940)
github.com/jesseduffield/lazygit/main.go:23 (0x10495c198)
runtime/internal/atomic/types.go:194 (0x104319f08)
runtime/asm_arm64.s:1172 (0x10434a624)
```
**Expected behavior**
Previous version can run in such repo.
**Screenshots**
NA
**Version info:**
lazygit --version
commit=, build date=, build source=homebrew, version=0.40.2, os=darwin, arch=arm64, git version=2.42.0
git --version
git version 2.42.0
**Additional context**
NA
**Note:** please try updating to the latest version or [manually building](https://github.com/jesseduffield/lazygit/#manual) the latest `master` to see if the issue still occurs.
Contributor guide
Assessment
This issue has not been assessed yet.