gitignore.rs
gitignore.rs copied to clipboard
Recurse ignore files in repo
Features
- The repo correctly recurses over a given path, picking out the correct ignore files to apply.
- Added a new ignore result enum
IgnoreResult
: A path can either be ignored, negated or undefined given a certain ruleset. This allows to properly map negation of child .gitignores
Issues not addressed by this MR
What if a negation is less specific then a directory exclude? Say we pass in the path some_dir/foo.rs
with the given .gitignore:
some_dir/
!foo.rs
a spec was added for this case.
This rule is specified in the gitgnore docs as:
It is not possible to re-include a file if a parent directory of that file is excluded.