pub struct IgnoreConfig { /* private fields */ }Expand description
Centralized ignore file configuration.
Threaded through KernelConfig → ExecContext → tools.
Runtime-mutable via the ignore builtin.
Implementations§
Source§impl IgnoreConfig
impl IgnoreConfig
pub fn scope(&self) -> IgnoreScope
Sourcepub fn auto_gitignore(&self) -> bool
pub fn auto_gitignore(&self) -> bool
Whether the FileWalker should auto-load nested .gitignore files.
pub fn use_defaults(&self) -> bool
pub fn files(&self) -> &[String]
pub fn set_scope(&mut self, scope: IgnoreScope)
pub fn set_defaults(&mut self, on: bool)
pub fn set_auto_gitignore(&mut self, on: bool)
Sourcepub fn set_use_global_gitignore(&mut self, on: bool)
pub fn set_use_global_gitignore(&mut self, on: bool)
Toggle whether the user’s global gitignore is loaded. When enabled,
the path comes from core.excludesFile (falling back to
~/.config/git/ignore per git’s lookup), unless an override has
been set via set_global_gitignore_path for tests.
pub fn use_global_gitignore(&self) -> bool
Sourcepub fn set_global_gitignore_path(&mut self, path: Option<PathBuf>)
pub fn set_global_gitignore_path(&mut self, path: Option<PathBuf>)
Test hook: substitute the global gitignore lookup with a fixed path. Production callers leave this unset.
pub fn add_file(&mut self, name: &str)
pub fn remove_file(&mut self, name: &str)
pub fn clear(&mut self)
Sourcepub async fn build_filter<F: WalkerFs>(
&self,
root: &Path,
fs: &F,
) -> Option<IgnoreFilter>
pub async fn build_filter<F: WalkerFs>( &self, root: &Path, fs: &F, ) -> Option<IgnoreFilter>
Build an IgnoreFilter from the configured file list and defaults.
Loads each ignore file relative to root via the given WalkerFs.
Returns None if no filtering is configured.
Ancestor walk-up. For each configured ignore filename, this also
walks up the directory tree from root and loads the same filename
from each ancestor. Rules from ancestor files are rebased onto the
walker’s relative-path frame: anchored rules pointing into the
walker’s subtree get their prefix stripped; rules pointing outside
are dropped; unanchored rules pass through unchanged. Matches git’s
behavior of honoring .gitignore files in any ancestor directory.
Closer ancestors get higher priority (added later).
Trait Implementations§
Source§impl Clone for IgnoreConfig
impl Clone for IgnoreConfig
Source§fn clone(&self) -> IgnoreConfig
fn clone(&self) -> IgnoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more