diff options
author | dana <dana@dana.is> | 2018-01-29 13:10:59 -0600 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-01-29 14:10:59 -0500 |
commit | 51864c13fc329332b9ebcf2a7e45e7b6aadeedbd (patch) | |
tree | c83a0b9e5ccb8b3c9544a89f184bdcd8308c3649 /ignore/src/overrides.rs | |
parent | 35f802166d1c5788e8c833f398d13b9c9e8cb360 (diff) |
ignore: fix handling of / in patterns
This commit makes handling of patterns containing a `/`
match actual git behaviour and the specification written
in `man gitignore`.
Fixes #761
Diffstat (limited to 'ignore/src/overrides.rs')
-rw-r--r-- | ignore/src/overrides.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ignore/src/overrides.rs b/ignore/src/overrides.rs index 03fd39c4..955dc5ad 100644 --- a/ignore/src/overrides.rs +++ b/ignore/src/overrides.rs @@ -202,8 +202,9 @@ mod tests { #[test] fn gitignore() { let ov = ov(&["/foo", "bar/*.rs", "baz/**"]); + assert!(ov.matched("bar/lib.rs", false).is_whitelist()); assert!(ov.matched("bar/wat/lib.rs", false).is_ignore()); - assert!(ov.matched("wat/bar/lib.rs", false).is_whitelist()); + assert!(ov.matched("wat/bar/lib.rs", false).is_ignore()); assert!(ov.matched("foo", false).is_whitelist()); assert!(ov.matched("wat/foo", false).is_ignore()); assert!(ov.matched("baz", false).is_ignore()); |