# git: Handle buffer file path changes \(\#41944\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d896af2f15e153b39e2c39195daf293fca4b41d1

Requested commit: d896af2f15e153b39e2c39195daf293fca4b41d1

Commit: d896af2f15e153b39e2c39195daf293fca4b41d1

Tree: 7a0c8805f74938163b182609a7485155f3638714

Author: Dino

Committer: GitHub

## Message

```
git: Handle buffer file path changes (#41944)

Update `GitStore.on_buffer_store_event` so that, when a
`BufferStoreEvent::BufferChangedFilePath` event is received, we check if
there's any diff state for the buffer and, if so, update it according to
the new file path, in case the file exists in the repository.

Closes #40499

Release Notes:

- Fixed issue with git diff tracking when updating a buffer's file from
an untracked to a tracked file
```

## Parents

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

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