git: Fix deletion icon button in branch list deleting the wrong branch#45087
Merged
Anthony-Eid merged 1 commit intomainfrom Dec 17, 2025
Merged
git: Fix deletion icon button in branch list deleting the wrong branch#45087Anthony-Eid merged 1 commit intomainfrom
Anthony-Eid merged 1 commit intomainfrom
Conversation
This bug happened because the deletion icon would also use the selected entry index to choose what branch to delete. This works for all cases except when hovering on an entry, so the fix was passing in the entry index to the deletion button on_click handler I also disabled the deletion button from working if a branch is HEAD, because it's an illegal operation to delete a branch a user is currently on. Finally, I made WeakEntity<Workspace> a non optional field on `BranchList` because a workspace should always be present, and it's used to show toast notifications when a git operations fails. The popover view wouldn't have a workspace before, so user's wouldn't get error messages when a git operation failed in that view.
HactarCE
pushed a commit
that referenced
this pull request
Dec 17, 2025
#45087) Closes #45033 This bug happened because the deletion icon would use the selected entry index to choose what branch to delete. This works for all cases except when hovering on an entry, so the fix was passing in the entry index to the deletion button on_click handler. I also disabled the deletion button from working if a branch is HEAD, because it's an illegal operation to delete a branch a user is currently on. Finally, I made WeakEntity<Workspace> a non-optional field on `BranchList` because a workspace should always be present, and it's used to show toast notifications when a git operation fails. The popover view wouldn't have a workspace before, so users wouldn't get error messages when a git operation failed in that view. Release Notes: - git: Fix bug where branch list deletion button would delete the wrong branch
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
zed-industries#45087) Closes zed-industries#45033 This bug happened because the deletion icon would use the selected entry index to choose what branch to delete. This works for all cases except when hovering on an entry, so the fix was passing in the entry index to the deletion button on_click handler. I also disabled the deletion button from working if a branch is HEAD, because it's an illegal operation to delete a branch a user is currently on. Finally, I made WeakEntity<Workspace> a non-optional field on `BranchList` because a workspace should always be present, and it's used to show toast notifications when a git operation fails. The popover view wouldn't have a workspace before, so users wouldn't get error messages when a git operation failed in that view. Release Notes: - git: Fix bug where branch list deletion button would delete the wrong branch
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
zed-industries#45087) Closes zed-industries#45033 This bug happened because the deletion icon would use the selected entry index to choose what branch to delete. This works for all cases except when hovering on an entry, so the fix was passing in the entry index to the deletion button on_click handler. I also disabled the deletion button from working if a branch is HEAD, because it's an illegal operation to delete a branch a user is currently on. Finally, I made WeakEntity<Workspace> a non-optional field on `BranchList` because a workspace should always be present, and it's used to show toast notifications when a git operation fails. The popover view wouldn't have a workspace before, so users wouldn't get error messages when a git operation failed in that view. Release Notes: - git: Fix bug where branch list deletion button would delete the wrong branch
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Feb 15, 2026
zed-industries#45087) Closes zed-industries#45033 This bug happened because the deletion icon would use the selected entry index to choose what branch to delete. This works for all cases except when hovering on an entry, so the fix was passing in the entry index to the deletion button on_click handler. I also disabled the deletion button from working if a branch is HEAD, because it's an illegal operation to delete a branch a user is currently on. Finally, I made WeakEntity<Workspace> a non-optional field on `BranchList` because a workspace should always be present, and it's used to show toast notifications when a git operation fails. The popover view wouldn't have a workspace before, so users wouldn't get error messages when a git operation failed in that view. Release Notes: - git: Fix bug where branch list deletion button would delete the wrong branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #45033
This bug happened because the deletion icon would use the selected entry index to choose what branch to delete. This works for all cases except when hovering on an entry, so the fix was passing in the entry index to the deletion button on_click handler.
I also disabled the deletion button from working if a branch is HEAD, because it's an illegal operation to delete a branch a user is currently on.
Finally, I made WeakEntity a non-optional field on
BranchListbecause a workspace should always be present, and it's used to show toast notifications when a git operation fails. The popover view wouldn't have a workspace before, so users wouldn't get error messages when a git operation failed in that view.Release Notes: