Skip to content

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

@brandondong

Description

@brandondong

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions