Clear pending staged/unstaged diff hunks hunks when writing to the git index fails (#26173)

Release Notes:

- Git Beta: Fixed a bug where discarding a hunk in the project diff view
performed two concurrent saves of the buffer.
- Git Beta: Fixed an issue where diff hunks appeared in the wrong state
after failing to write to the git index.
314ad5dd5fMax Brunsfeld committed on 3/6/2025, 2:45:09 AM· committed by GitHubparentd3c6865
14 files changedLine totals unavailable