This updates our internal fork of the `ignore` crate to incorporate changes from the latest release [v0.4.24](https://github.com/BurntSushi/ripgrep/compare/ignore-0.4.23...ignore-0.4.24). Aside: We should look into opening issues about the changes we had to make to see if they could be addressed in the crate itself so we can get rid of our fork.
17 lines
568 B
Rust
17 lines
568 B
Rust
use ignore::gitignore::GitignoreBuilder;
|
|
|
|
const IGNORE_FILE: &'static str = "tests/gitignore_skip_bom.gitignore";
|
|
|
|
/// Skip a Byte-Order Mark (BOM) at the beginning of the file, matching Git's
|
|
/// behavior.
|
|
///
|
|
/// Ref: <https://github.com/BurntSushi/ripgrep/issues/2177>
|
|
#[test]
|
|
fn gitignore_skip_bom() {
|
|
let mut builder = GitignoreBuilder::new("ROOT");
|
|
let error = builder.add(IGNORE_FILE);
|
|
assert!(error.is_none(), "failed to open gitignore file");
|
|
let g = builder.build().unwrap();
|
|
|
|
assert!(g.matched("ignore/this/path", false).is_ignore());
|
|
}
|