# file_finder: Respect \.gitignore and file_scan_inclusions with \*\* in glob \(\#40654\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a827f25d00247d53f8a80bb4a080868b263f317f

Requested commit: a827f25d00247d53f8a80bb4a080868b263f317f

Commit: a827f25d00247d53f8a80bb4a080868b263f317f

Tree: 021f754a6e0bf5f60ddad36ba9c598b1052e282b

Author: Coenen Benjamin

Committer: GitHub

## Message

```
file_finder: Respect .gitignore and file_scan_inclusions with ** in glob (#40654)

Closes #39037 

Previously, the code split the `**/.env` glob in `file_scan_inclusions`
into two sources for the `PathMatcher`: `["**", "**/.env"]`. This
approach works for directories, but including `**` will match all
directories and their files. To address this, I now select the
appropriate `PathMatcher` using only `**/.env` when specifically
targeting a file to determine whether to include it in the file finder.

Release Notes:

- Fixed: respect `.gitignore` and `file_scan_inclusions` settings with
`**` in glob for file finder

---------

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
```

## Parents

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

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