Skip to content

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

Merged
cole-miller merged 1 commit intov0.224.xfrom
cherry-pick-path-key-fix-v0.224.x
Feb 20, 2026
Merged

git: Prevent panic when updating excerpts in split diff (cherry-pick #49725)#49731
cole-miller merged 1 commit intov0.224.xfrom
cherry-pick-path-key-fix-v0.224.x

Conversation

@cole-miller
Copy link
Member

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.

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>
@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 staff Pull requests authored by a current member of Zed staff label Feb 20, 2026
@cole-miller cole-miller changed the title git: Prevent panic when updating excerpts in split diff (#49725) git: Prevent panic when updating excerpts in split diff (cherry-pick #49725) Feb 20, 2026
@cole-miller cole-miller merged commit 922ee36 into v0.224.x Feb 20, 2026
37 checks passed
@cole-miller cole-miller deleted the cherry-pick-path-key-fix-v0.224.x branch February 20, 2026 16:39
@theherk
Copy link
Contributor

theherk commented Feb 20, 2026

3 releases in one day. That must be a record. Quick turnaround. 👍

@vickyqt
Copy link

vickyqt commented Feb 20, 2026

3 releases in one day. That must be a record. Quick turnaround. 👍

I am also surprised, I was seeing the "restart to update" after other coffee break.

@Alexander-vecos
Copy link

Inspect security and comit

@Alexander-vecos
Copy link

Next step?

Copy link

@Alexander-vecos Alexander-vecos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нихера не понял, я что сейчас поделился проектом который у кого-то списал и мне типа помогают его вместе с капилотом?)

@xpe
Copy link

xpe commented Feb 23, 2026

@cole-miller In an attempt to understand the three comments above (and especially the last one) I asked Claude to explain. The upshot being:

Claude: Their Russian comment translates to: "I didn't understand a damn thing — did I just share a project that I copied from someone, and now they're helping me develop it together with Copilot?"

Claude: This suggests they thought they were in their own repository — perhaps one they had forked or copied. They're confused about why strangers seem to be working on it. Then they apparently realized they were just looking at someone else's public repo the whole time, and none of this had anything to do with them.

me: But why does GitHub show the whole world they "approved these changes"?

Claude: Because GitHub allows anyone to submit a review on a public pull request — including "approve." It's a quirk of GitHub's permissions model. Approval from a non-maintainer is visually identical in the thread to approval from a maintainer, but it carries no actual weight. Only approvals from people with write access to the repo matter for merge requirements.

Claude: So Alexander-vecos clicked approve, probably not understanding what that button does, and GitHub dutifully logged it publicly like it meant something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants