jesseduffield / jesseduffield/lazygit
lazygit deletes/operates the wrong file
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
When you create a directory and file inside that directory over a deleted symlink you get into a situation where the selected file on the GUI is not the file that is being operated on. This can unfortunately lead you to delete (in my case) files you weren't expecting too :cry: .
**To Reproduce**
The following commands will quickly reproduce this:
```
mkdir testrepo
cd testrepo
touch a
mkdir testdir
touch testdir/b
ln -s testdir test_symlink
git init .
git add .
git commit -m "test_commit"
rm test_symlink
mkdir test_symlink
touch test_symlink/c
touch z
lazygit
```
**Expected behavior**
For the selected file to match the file thats being operated on.
**Screenshots**

Notice the file that's selected is not the file that's being operated on in the unstaged changes window.
**Version info:**
```
➜ go install github.com/jesseduffield/lazygit@v0.44.1
➜ lazygit -v
commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64, git version=2.41.0
```
Contributor guide
Assessment
This issue has not been assessed yet.