Unable to delete file when the repository will be empty

Hello,

First, thank you for this incredible package!

I get the following error when I try to remove the latest file in a repository and commit:

cannot create empty commit: clean working tree

I think the issue is due to the index entries being empty when the tree is built here:

if len(idx.Entries) == 0 && (opts == nil || !opts.AllowEmptyCommits) {

Here is a screenshot of my debugging session:

swappy-20230327-174441

You can see that the index entries are empty, but I have a change staged and ready to be committed.

Here is the code that you can use to reproduce my issue: https://gist.github.com/Erouan50/e2c8ec8d8ad21c7f3761b5f193ab6171#file-main-go

I'll create a pull request if you agree it is a bug.

Thank you!