# Separate repository state synchronization from worktree synchronization \(\#27140\) · gitcafe/zed

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

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

Visibility: public

Requested revision: bc1c0a22974e13f8ef75d0db1ca93e7c51077237

Requested commit: bc1c0a22974e13f8ef75d0db1ca93e7c51077237

Commit: bc1c0a22974e13f8ef75d0db1ca93e7c51077237

Tree: 9ac767ac8a39dcd7dcff2e65f249842075c77c55

Author: Cole Miller

Committer: GitHub

## Message

```
Separate repository state synchronization from worktree synchronization (#27140)

This PR updates our DB schemas and wire protocol to separate the
synchronization of git statuses and other repository state from the
synchronization of worktrees. This paves the way for moving the code
that executes git status updates out of the `worktree` crate and onto
the new `GitStore`. That end goal is motivated by two (related) points:

- Disentangling git status updates from the worktree's
`BackgroundScanner` will allow us to implement a simpler concurrency
story for those updates, hopefully fixing some known but elusive bugs
(upstream state not updating after push; statuses getting out of sync in
remote projects).
- By moving git repository state to the project-scoped `GitStore`, we
can get rid of the duplication that currently happens when two worktrees
are associated with the same git repository.

Co-authored-by: Max <max@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
```

## Parents

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

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