git: Prevent panic when updating excerpts in split diff (cherry-pick #49725)#49731
git: Prevent panic when updating excerpts in split diff (cherry-pick #49725)#49731cole-miller merged 1 commit intov0.224.xfrom
Conversation
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>
|
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. |
|
Inspect security and comit |
|
Next step? |
Alexander-vecos
left a comment
There was a problem hiding this comment.
Нихера не понял, я что сейчас поделился проектом который у кого-то списал и мне типа помогают его вместе с капилотом?)
|
@cole-miller In an attempt to understand the three comments above (and especially the last one) I asked Claude to explain. The upshot being:
|
When using the split view, if the project diff inserts excerpts for the same buffer using two different
PathKeys, we panic insideLhsEditor::update_path_excerpts_from_rhsbecause of an implicit assumption thatexcerpts_for_path()andexcerpts_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: