# git_ui: Add action to toggle diff base \(\#62966\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 1ea16c1ab9dd6d36649e002dc60995634da04daf

Requested commit: 1ea16c1ab9dd6d36649e002dc60995634da04daf

Commit: 1ea16c1ab9dd6d36649e002dc60995634da04daf

Tree: c7a6b1800f615ff82ed942d3036dc8c5c60f0419

Author: Ben Kunkle

Committer: GitHub

## Message

```
git_ui: Add action to toggle diff base (#62966)

# Objective

- Make it easy to switch Git features between showing uncommitted
changes and all changes on the current branch.

## Solution

- Add `git::ToggleDiffBase`, which toggles the user setting between
`head` and `default_branch`.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Git: Added an action to toggle the diff base between HEAD and the
default branch.
```

## Parents

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

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