Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[path] Also match parent dirs in include/exclude
NOTE: This is a major change in pattern matching for `include` and `exclude` fields, and can result in additional inclusion/exclusion for some patterns. Previously, for inclusion/exclusion matters, Cargo only works with paths of files in a package/repository, and glob pattern matching has been applying only to these file paths. The old behavior results in some unexpected behavior. For example, having: ```toml exclude = ["data"] ``` in a manifest next to a `data` directory, it will not exclude the directory. To make it work, a pattern must be provided that matches the *files* under this directory, like: ```toml exclude = ["data/*"] ``` To make Cargo's inclusion/exclusion behavior more intutional, and bring it on par with similar systems, like `gitignore`, we need to also match these patterns with the *directories*. The directories are seen internally as *parents* of the files. Therefore, this diff expands the pattern matching to files and their parent directories. Now, it's easier to exclude all data files: ```toml exclude = ["data"] ``` or include only the `src` directory: ```toml include = ["src"] ``` Fixes <rust-lang#3578>
- Loading branch information