# Fix flickering when staging and unstaging files \(\#27931\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e1a8a31fa40007141def8c862f0ec0e96f8c155a

Requested commit: e1a8a31fa40007141def8c862f0ec0e96f8c155a

Commit: e1a8a31fa40007141def8c862f0ec0e96f8c155a

Tree: c209aad5c51bf99daf2d812f8ac50c0705dfc777

Author: Cole Miller

Committer: GitHub

## Message

```
Fix flickering when staging and unstaging files (#27931)

This fixes a bug in #27568 that caused flickering in the git panel's
checkbox state when staging and unstaging entire files. The problem is
that that stage/unstage action first saves the target path (if it's open
as a buffer), and we do a targeted git status scan in response to that
filesystem event, which makes its way to the git panel and causes it to
clear its pending state before the actual stage or unstage has gone
through.

The fix is to not clear the panel's pending state for git repository
events that originated from a targeted scan (i.e. one that was triggered
by FS events for repo paths, as opposed to events inside `.git` which
cause all statuses to be recomputed).

Release Notes:

- N/A
```

## Parents

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

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