# Respect \.git/info/exclude in secondary worktrees \(\#51536\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 99c67b8d152be04c138500a6d49b552ab485f046

Requested commit: 99c67b8d152be04c138500a6d49b552ab485f046

Commit: 99c67b8d152be04c138500a6d49b552ab485f046

Tree: cac59418576db461d6296b2836655f8c278ab182

Author: Fanteria

Committer: GitHub

## Message

```
Respect .git/info/exclude in secondary worktrees (#51536)

Closes #50880 

When a git worktree linked via a `.git` file (e.g. `gitdir:
/repo/.git/worktrees/my-worktree`) was opened in Zed, entries in
`.git/info/exclude` were not respected. This is now fixed.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed `.git/info/exclude` not being respected when opening a secondary
git worktree


https://github.com/user-attachments/assets/f38df5dc-96eb-40a8-a77c-0932a2c8575b

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
```

## Parents

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

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