I'm going to do my best to explain this confusing bug.
Say you are in a git repository.
If you add a file called file.txt, head to the git tab, and then stage it, it switches to the staged section as expected.
However, if you delete this file, it disappears from the staged section - again, as expected.
But once you do commit, you will see that one pending change which was not visible before is now showing itself - the deletion of file.txt!
@RDIL do you mind confirming the same behavior in vscode?
Eventually support for @theia/git will be dropped in favor of vscode-builtin-git and vscode-builtin-git-ui.
@vince-fugnitto In Gitpod @theia/git is used.
@vince-fugnitto In Gitpod
@theia/gitis used.
Yes I know, just wanted to confirm if it also an issue in vscode and with the builtins.
My reasoning was if it is a bug only with @theia/git and that it is a small corner case that the bug is not a big priority.
for me at step 5 I see this:

but it commits the addition of the file which is what I would expect.
and in the git tab, I still have the deletion of the file as a change, yet to be staged/commited.
Alright so this is only in Theia
However, if you delete this file, it disappears from the staged section - again, as expected.
No, that is not as expected. Deleting the file deletes it in the working tree. It does not affect the index. Seeing the deletion after one has committed is correct because the file was added in the commit.
The error is in fact that the file does not show at all after the deletion and before the commit. It should show as added in the staged changes and deleted in the unstaged changes. The problem is caused by these lines:
The comment is incorrect. Those lines just need to be removed. One will then see the file added in the staged changes and deleted in the unstaged changes as expected (i.e. as vscode does and as git-gui does).
Pull-request created https://github.com/theia-ide/dugite-extra/pull/36
Most helpful comment
Yes I know, just wanted to confirm if it also an issue in vscode and with the builtins.
My reasoning was if it is a bug only with
@theia/gitand that it is a small corner case that the bug is not a big priority.