# git_ui: Improve delete branch tests to verify underlying repository state \(\#51825\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c44f13cca02632b2e3159a6af78b66701ef9a2e8

Requested commit: c44f13cca02632b2e3159a6af78b66701ef9a2e8

Commit: c44f13cca02632b2e3159a6af78b66701ef9a2e8

Tree: c9df725f486f90c3bf8426d33e1e38ff7bee475c

Author: ᴀᴍᴛᴏᴀᴇʀ

Committer: GitHub

## Message

```
git_ui: Improve delete branch tests to verify underlying repository state (#51825)

While fixing the tests in the previous PR (#48338), I noticed that the
`delete_branch` tests only verified the UI state changes rather than the
actual state of the underlying repository.

Currently, if `delete_branch` were a no-op that returned Ok(), the tests
would still pass incorrectly. This PR addresses that gap by ensuring the
branch is actually removed from the repository.

|Before|After|
|--|--|
|<img width="3476" height="2564" alt="图片"
src="https://github.com/user-attachments/assets/f5c4c5c4-64fe-4074-9fff-fb166d160d77"
/>|<img width="3476" height="2564" alt="CleanShot 2026-03-18 at 17 51
36@2x"
src="https://github.com/user-attachments/assets/47419d37-5051-4139-969e-65a1347bf555"
/>|

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

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

## Parents

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

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