# worktree: Anchor ignore rules at the repository they belong to \(\#62325\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 83dc1967d05cf2daac5ee6dd03dd25c1b00ec46c

Requested commit: 83dc1967d05cf2daac5ee6dd03dd25c1b00ec46c

Commit: 83dc1967d05cf2daac5ee6dd03dd25c1b00ec46c

Tree: 28a414f1d2dd1a78c363aaf07cb725977dce764b

Author: Henrique Ferreiro

Committer: GitHub

## Message

```
worktree: Anchor ignore rules at the repository they belong to (#62325)

Since #60772, a worktree's ignore rules are also applied to the
directories above its root. Because of this, an `info/exclude` pattern
naming one of those parent directories marks it as ignored, and with it
the whole worktree below.

Stop the walk at the repository containing the worktree root.

Also skip exclude rules for paths outside the work directory they are
anchored at, as `.gitignore` and global gitignore rules already do.

Release Notes:

- Fixed a worktree being reported as entirely ignored when its
repository's `info/exclude` named one of the worktree's parent
directories
```

## Parents

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

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