Skip to content

Fix the filtering of index.lock + COMMIT_MESSAGE FS events to work in linked worktrees#57763

Merged
maxbrunsfeld merged 2 commits into
mainfrom
git-fixes
May 27, 2026
Merged

Fix the filtering of index.lock + COMMIT_MESSAGE FS events to work in linked worktrees#57763
maxbrunsfeld merged 2 commits into
mainfrom
git-fixes

Conversation

@maxbrunsfeld
Copy link
Copy Markdown
Collaborator

@maxbrunsfeld maxbrunsfeld commented May 26, 2026

Zed reloads a lot of data about a git repository any time any file changes inside of the .git directory, with the exception of a few known paths that we know do not warrant a reload, such as index.lock and COMMIT_MESSAGE. Previously, we ignored FS events for those files, but we used a specific path that only worked for the main worktree. This caused a lot of unnecessary reloads when using linked worktrees. Now we ignore those files in a general way, by their filename, so that the optimization applies to linked worktrees as well.

@cole-miller Noticed this bug.

Release Notes:

  • Fixed unnecessary reloading of Git state that could occur when editing in linked worktrees.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 26, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 26, 2026
@maxbrunsfeld maxbrunsfeld added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit 4129fc8 May 27, 2026
45 checks passed
@maxbrunsfeld maxbrunsfeld deleted the git-fixes branch May 27, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants