Skip to content

git: Prevent panic when updating excerpts in split diff (#49725) (cherry-pick to preview)#49729

Merged
zed-zippy[bot] merged 1 commit intov0.225.xfrom
cherry-pick-v0.225.x-40c159c8
Feb 20, 2026
Merged

git: Prevent panic when updating excerpts in split diff (#49725) (cherry-pick to preview)#49729
zed-zippy[bot] merged 1 commit intov0.225.xfrom
cherry-pick-v0.225.x-40c159c8

Conversation

@zed-zippy
Copy link
Copy Markdown
Contributor

@zed-zippy zed-zippy bot commented Feb 20, 2026

Cherry-pick of #49725 to preview


When using the split view, if the project diff inserts excerpts for the
same buffer using two different PathKeys, we panic inside
LhsEditor::update_path_excerpts_from_rhs because of an implicit
assumption that excerpts_for_path() and excerpts_for_buffer() return
the same number of values. This PR addresses that by ignoring any
excerpts for the given buffer that have a different path key from the
provided one.

Release Notes:

  • Fixed a crash when using the split diff view.

Co-authored-by: Jakub Konka kubkon@jakubkonka.com
Co-authored-by: Eric eric@zed.dev

When using the split view, if the project diff inserts excerpts for the
same buffer using two different `PathKey`s, we panic inside
`LhsEditor::update_path_excerpts_from_rhs` because of an implicit
assumption that `excerpts_for_path()` and `excerpts_for_buffer()` return
the same number of values. This PR addresses that by ignoring any
excerpts for the given buffer that have a different path key from the
provided one.

Release Notes:

- Fixed a crash when using the split diff view.

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Eric <eric@zed.dev>
@zed-zippy zed-zippy bot requested a review from a team as a code owner February 20, 2026 16:16
@zed-zippy zed-zippy bot requested review from cole-miller and dinocosta and removed request for a team February 20, 2026 16:16
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 20, 2026
@zed-community-bot zed-community-bot bot added the bot Pull requests authored by a bot label Feb 20, 2026
@zed-zippy zed-zippy bot merged commit a81f96d into v0.225.x Feb 20, 2026
37 checks passed
@zed-zippy zed-zippy bot deleted the cherry-pick-v0.225.x-40c159c8 branch February 20, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant