# Fix unnecessary gitignore status updates due to failure to clear 'needs update' flag \(\#13471\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c6c59076930c44156efd4c414aa0cf18b503ff2e

Requested commit: c6c59076930c44156efd4c414aa0cf18b503ff2e

Commit: c6c59076930c44156efd4c414aa0cf18b503ff2e

Tree: bbefd4ad4202f680855eeecfa75979a544976614

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix unnecessary gitignore status updates due to failure to clear 'needs update' flag (#13471)

I found this bug while investigating
https://github.com/zed-industries/zed/issues/13176. When running zed
with `RUST_LOG=worktree=trace`, I realized we were updating all
gitignore statuses on every file change. This was due to a logic error
where we were marking a gitignore as up-to-date on a temporary *clone*
of our snapshot, but not in the `BackgroundScanner` itself.

Release Notes:

- Fixed a bug that caused unnecessary computations to happen on every
file-system event.
```

## Parents

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

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