# git_graph: Refresh UI when stash/branch list has changed \(\#53094\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7748047051bc5886269a2d2ee1d4aa5bdd910471

Requested commit: 7748047051bc5886269a2d2ee1d4aa5bdd910471

Commit: 7748047051bc5886269a2d2ee1d4aa5bdd910471

Tree: c6a23f8782b8f48c7bc21d03d31b7cc9934b2197

Author: Anthony Eid

Committer: GitHub

## Message

```
git_graph: Refresh UI when stash/branch list has changed (#53094)

### Summary 

This PR fixes an issue where the git graph wouldn't refresh its state
correctly unless HEAD changed. Now repository emits events when the
branch list has changed, and invalidates the graph data cache when the
stash or branch list has changed.

I also renamed the event `Repository::BranchedChanged` to
`Repository::HeadChanged` as well.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53080

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

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

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