mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Previously the worktree's handling of events inside gitdirs looked like this: - First, deduplicate paths for which we received events by dropping any path that is a suffix of another one - Then, filter out events for deliberately ignored paths like `.git/index.lock` - Finally, collect a set of affected gitdirs based on the paths that remain This doesn't work on Windows, because when events occur for paths inside `.git` we also get an event for `.git` itself. The deduplication steps drops `.git/index.lock` before we get the chance to filter it out in the second step. This causes us to rescan git state unnecessarily on Windows. This PR fixes the issue by moving the filtering of ignored paths, and also the handling of `.git/info/exclude`, to just before the deduplication step. We also filter out events for the `.git` directory itself, so that if the batch of events looks like `[".git", ".git/index.lock"]`, we don't trigger `WorktreeUpdatedGitRepositories`. Self-Review Checklist: - [ ] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - N/A or Added/Fixed/Improved ... |
||
|---|---|---|
| .. | ||
| src | ||
| tests/integration | ||
| Cargo.toml | ||
| LICENSE-GPL | ||