Expand description
Parse .gitignore files and provide utilities to match against them.
§Examples
use gix_glob::pattern::Case;
let search = gix_ignore::Search::from_overrides(["target/", "!target/keep.me"], Default::default());
let ignored = search
.pattern_matching_relative_path("target".into(), Some(true), Case::Sensitive)
.unwrap();
assert_eq!(ignored.sequence_number, 1);
assert_eq!(ignored.kind, gix_ignore::Kind::Expendable);
assert!(!ignored.pattern.is_negative());
let kept = search
.pattern_matching_relative_path("target/keep.me".into(), Some(false), Case::Sensitive)
.unwrap();
assert_eq!(kept.sequence_number, 2);
assert!(kept.pattern.is_negative());§Feature Flags
serde— Data structures implementserde::Serializeandserde::Deserialize.
Re-exports§
pub use gix_glob as glob;
Modules§
Structs§
- Search
- A grouping of lists of patterns while possibly keeping associated to their base path in order to find matches.
Enums§
- Kind
- The kind of ignored item.
Functions§
- parse
- Parse git ignore patterns, line by line, from
bytes.