# Fix the filtering of index.lock \+ COMMIT_MESSAGE FS events to work in linked worktrees \(\#57763\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4129fc87d8bc023d5ae528f22f8299bd7a3b94c9

Requested commit: 4129fc87d8bc023d5ae528f22f8299bd7a3b94c9

Commit: 4129fc87d8bc023d5ae528f22f8299bd7a3b94c9

Tree: ece68ade7da97ab8da6f15d77f5e907184096709

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix the filtering of index.lock + COMMIT_MESSAGE FS events to work in linked worktrees (#57763)

Zed reloads a lot of data about a git repository any time any file
changes inside of the `.git` directory, with the exception of a few
known paths that we know do not warrant a reload, such as `index.lock`
and `COMMIT_MESSAGE`. Previously, we ignored FS events for those files,
but we used a specific path that only worked for the main worktree. This
caused a lot of unnecessary reloads when using linked worktrees. Now we
ignore those files in a general way, by their filename, so that the
optimization applies to linked worktrees as well.

@cole-miller Noticed this bug.

Release Notes:

- Fixed unnecessary reloading of Git state that could occur when editing
in linked worktrees.
```

## Parents

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

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