# Fix staging and unstaging of added and deleted files \(\#25631\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ebccef1aa4a95db26f0ec81b7c9a8f397b3de508)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ebccef1aa4a95db26f0ec81b7c9a8f397b3de508

Requested commit: ebccef1aa4a95db26f0ec81b7c9a8f397b3de508

Commit: ebccef1aa4a95db26f0ec81b7c9a8f397b3de508

Tree: 31f8536d9fdd9aa5d2aae4883ba45cf3d38c5bf0

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix staging and unstaging of added and deleted files (#25631)

* When staging in a buffer whose file has been deleted, do not save the
file
* Fix logic for writing to index when file is deleted

Release Notes:

- N/A
```

## Parents

- [33754f8eac2d1faf4913a4008c1656f13093e237](https://git.cafe/gitcafe/zed/commit/33754f8eac2d1faf4913a4008c1656f13093e237?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ebccef1aa4a95db26f0ec81b7c9a8f397b3de508?format=markdown)
