jesseduffield / jesseduffield/lazygit

Not starting when trying to use in submodule of symlinked submodule

Open
#1,865 6 comments 3 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**
When intending to use inside submodule of a symlinked submodule, there is this error with latest release (version 0.34):
```
2022/04/07 18:59:04 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*errors.errorString repository does not exist
/home/runner/work/lazygit/lazygit/main.go:145 (0xa8c8c5)
/opt/hostedtoolcache/go/1.16.15/x64/src/runtime/proc.go:225 (0x4389b6)
/opt/hostedtoolcache/go/1.16.15/x64/src/runtime/asm_amd64.s:1371 (0x46c5e1)
```

Everything works in the following scenarios:
- Use inside nested submodule but in original path of parent submodule.
- Use inside symlinked "parent" submodule.
- Use inside independent git repo inside symlinked "parent" submodule.

This seems like it should have been fixed in #789, but, unfortunately, I don't see this working.

**To Reproduce**
Steps to reproduce the behavior:
1. Set up repo.
2. Set up submodule inside repo.
3. Make symlink to submodule.
4. Set up submodule inside submodule.
5. Go to directory of nested submodule inside symlink and try running `lazygit` (I see error).

For more context, this happens inside [my dotfiles](https://github.com/echasnovski/dotfiles). It has submodule `neovim/.config/nvim` ([link to repo](https://github.com/echasnovski/nvim)), which I symlink to `~/.config/nvim` while dotfiles are in `~/dotfiles`. The `nvim` submodule in turn has many own submodules for plugins (in [`pack/plugins/opt`](https://github.com/echasnovski/nvim/tree/master/pack/plugins/opt) directory). So trying to run `lazygit`:
- **Fails** when inside any of those plugin subdirectories in symlinked directory (like `~/.config/nvim/pack/plugins/opt/gitsigns`).
- **Works** inside those subdirectories but not in symlinked path (like `~/dotfiles/neovim/.config/nvim/pack/plugins/opt/gitsigns`).
- **Works** inside non-submodule of symlinked directory (like created git repo inside `~/.config/nvim/pack/plugins/opt`).

**Expected behavior**
`lazygit` can start in submodule of symlinked submodule.

**Screenshots**
No screenshot.

**Desktop (please complete the following information):**
- OS: Xubuntu 20.04
- Lazygit Version: 0.34
- The last commit id if you built project from sources: commit=7be25a105d389a262ef040133a4270f2f745d255 (via `lazygit --version`).

**Additional context**
Add any other context about the problem here.

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.