Skip to content

Commit d22d86b

Browse files
Fix panic in the git panel when toggling sort_by_path (#43074) (cherry-pick to stable) (#43128)
Cherry-pick of #43074 to stable ---- We call `entry_by_path` on the `bulk_staging` anchor entry at the beginning of `update_visible_entries`, but in the codepath where `sort_by_path` is toggled on or off, we clear entries without clearing `bulk_staging` or counts, causing that `entry_by_path` to do an out of bounds index. Fixed by clearing `bulk_staging` as well. Release Notes: - N/A Co-authored-by: Cole Miller <cole@zed.dev>
1 parent 9700929 commit d22d86b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/git_ui/src/git_panel.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ impl GitPanel {
373373
let is_sort_by_path = GitPanelSettings::get_global(cx).sort_by_path;
374374
if is_sort_by_path != was_sort_by_path {
375375
this.entries.clear();
376+
this.bulk_staging.take();
376377
this.update_visible_entries(window, cx);
377378
}
378379
was_sort_by_path = is_sort_by_path

0 commit comments

Comments
 (0)