# Make worktree \`UpdatedEntries\` events fully describe all changes \(\#2533\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e4530471de8edb459b873db08d0c640b5fef1680

Requested commit: e4530471de8edb459b873db08d0c640b5fef1680

Commit: e4530471de8edb459b873db08d0c640b5fef1680

Tree: 8aa3c6991bd2d2eb04302a15c7fb77fea953dbef

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Make worktree `UpdatedEntries` events fully describe all changes (#2533)

This PR makes the worktree's change events more useful in a few ways:

* The changes are now described by a cheaply clone-able collection, so
that they can be used in background tasks. Right now, I'm using a simple
Arc slice.
* The `UpdatedEntries` event now captures not only changes due to FS
changes, but also newly-loaded paths that are discovered during the
initial scan.
* The `UpdatedGitRepositories` event now includes repositories whose
work-dir changed but git dir didn't change. A boolean flag is included,
to indicate whether the git content changed.
* The `UpdatedEntries` and `UpdatedGitRepositories` events are now
*used* to compute the worktree's `UpdateWorktree` messages, used to sync
changes to guests. This unifies two closely-related code paths, and
makes the host more efficient when collaborating, because the
`UpdateWorktree` message computation used to require walking the entire
`entries` tree on every FS change.
```

## Parents

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

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

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