# Fix regression in handling git FS events \(\#2670\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f83514cde48f3f7d710bf66a0597187eddf112ad

Requested commit: f83514cde48f3f7d710bf66a0597187eddf112ad

Commit: f83514cde48f3f7d710bf66a0597187eddf112ad

Tree: cc0fbe97502042577c085245300a4f0b97e97a2f

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix regression in handling git FS events (#2670)

As part of an optimization in
https://github.com/zed-industries/zed/pull/2663, I changed the way that
the worktree ignores FS events within unloaded directories. But this
accidentally prevented us from detecting some events that occur inside
of `.git` directories.

In this PR, I've made further tweaks to which FS events we can ignore.
We now explicitly opt *in* to scanning `.git` (shallowly) directories
(even though they are ignored). Note that we still don't recursively
scan the git directory (including all of the files inside `objects`
etc). This seems like the correct amount of work to do, and from my
testing (and our unit tests that use the real FS and real git
repositories), it seems to work correctly.

Release Notes:

- Fixed a bug where Zed would not detect some git repository changes
(preview only).
```

## Parents

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

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

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