jesseduffield / lazygit

simple terminal UI for git commands
MIT License
51.38k stars 1.8k forks source link

Range select -> stage fails when deleted file is already staged #3603

Closed brandondong closed 1 month ago

brandondong commented 4 months ago

Describe the bug

Range select -> stage fails when deleted file is already staged.

To Reproduce Steps to reproduce the behavior:

git init
echo "A" > file-a
git add -A
git commit -m "commit 1"
rm file-a
git add file-a
echo "B" > file-b
lazygit

Range select both files (shift + down arrow) and then hit space. The operation fails.

Expected behavior

file-b should become staged and no change happens to the status of file-a

Screenshots

image

Version info:

> lazygit --version
commit=v0.41.0, build date=2024-03-23T09:30:36Z, build source=binaryRelease, version=0.41.0, os=linux, arch=amd64, git version=2.45.1
> git --version
git version 2.45.1

Additional context

Reproducible on latest master.