# git: Retain "since" diffs in the \`GitStore\` \(\#47619\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 786b17dbebb635c7995d13dc4bb775e7330c7a90

Requested commit: 786b17dbebb635c7995d13dc4bb775e7330c7a90

Commit: 786b17dbebb635c7995d13dc4bb775e7330c7a90

Tree: 67da8b3ecf9b86ed70631860919316f4ec595632

Author: Cole Miller

Committer: GitHub

## Message

```
git: Retain "since" diffs in the `GitStore` (#47619)

This PR makes it so that `open_diff_since`, as used by the branch diff,
is able to return a stable diff entity instead of creating a new one
every time this is called. In particular, the base text buffer for this
diff is now stable across branch diff refreshes, making it usable with
the side-by-side view. The strategy for keeping the diff entities alive
is the same one that we use for the uncommitted and unstaged diffs--the
`GitStore` only holds a weak pointer to each "since" diff, so when these
diffs are no longer in use by the branch diff multibuffer they can be
cleaned up.

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
```

## Parents

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

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