# Fix panic in the git panel when toggling \`sort_by_path\` \(\#43074\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/5e21457f2162b23ee04c3587a5dd6164af978dac)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 5e21457f2162b23ee04c3587a5dd6164af978dac

Requested commit: 5e21457f2162b23ee04c3587a5dd6164af978dac

Commit: 5e21457f2162b23ee04c3587a5dd6164af978dac

Tree: eadb5e44b7daa010eb34033eb982daff8f0d750c

Author: Cole Miller

Committer: GitHub

## Message

```
Fix panic in the git panel when toggling `sort_by_path` (#43074)

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
```

## Parents

- [f312215e935b26722816d2f5c6967231098abcd8](https://git.cafe/gitcafe/zed/commit/f312215e935b26722816d2f5c6967231098abcd8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/5e21457f2162b23ee04c3587a5dd6164af978dac?format=markdown)
