pub struct PathspecMatcher<'s> { /* private fields */ }Expand description
A resolved pathspec list bound to one repository’s matching rules, built by
crate::repo::Repository::pathspec_matcher.
Holds the repository’s attributes when a spec carries :(attr:...) magic, so testing many
paths reads them once. Attr requirements see [attr] macro expansion and match attribute
patterns case-insensitively when core.ignorecase is set, as Git does. Paths are treated as regular files: a spec ending in / does not match
a path equal to its directory, and builtin_objectmode reads as 100644. Use
matches_pathspec_list_for_object when the entry mode matters.
Implementations§
Source§impl<'s> PathspecMatcher<'s>
impl<'s> PathspecMatcher<'s>
Sourcepub fn matches(&self, path: &str) -> bool
pub fn matches(&self, path: &str) -> bool
Whether path is selected: it matches at least one positive spec (any path when there
are none or the list is empty) and no :(exclude) spec.
Trait Implementations§
Source§impl<'s> Clone for PathspecMatcher<'s>
impl<'s> Clone for PathspecMatcher<'s>
Auto Trait Implementations§
impl<'s> Freeze for PathspecMatcher<'s>
impl<'s> RefUnwindSafe for PathspecMatcher<'s>
impl<'s> Send for PathspecMatcher<'s>
impl<'s> Sync for PathspecMatcher<'s>
impl<'s> Unpin for PathspecMatcher<'s>
impl<'s> UnsafeUnpin for PathspecMatcher<'s>
impl<'s> UnwindSafe for PathspecMatcher<'s>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more