pub struct WorktreeRules { /* private fields */ }Expand description
Attribute/ignore/conversion state shared across one porcelain operation.
Implementations§
Source§impl WorktreeRules
impl WorktreeRules
Sourcepub fn from_repository(repo: &Repository, index: &Index) -> Result<Self>
pub fn from_repository(repo: &Repository, index: &Index) -> Result<Self>
Build rules context from repo, using index for in-index .gitattributes fallbacks.
§Errors
Returns I/O or config errors from loading global exclude/attribute sources.
Sourcepub fn from_parts(
repo: &Repository,
index: &Index,
config: Arc<ConfigSet>,
) -> Result<Self>
pub fn from_parts( repo: &Repository, index: &Index, config: Arc<ConfigSet>, ) -> Result<Self>
Build rules when the caller already holds a config snapshot.
§Errors
Returns I/O errors from loading exclude/attribute files.
Sourcepub fn from_checkout_prospective_index(
repo: &Repository,
prospective_index: &Index,
config: Arc<ConfigSet>,
) -> Result<Self>
pub fn from_checkout_prospective_index( repo: &Repository, prospective_index: &Index, config: Arc<ConfigSet>, ) -> Result<Self>
Build attribute/conversion context for tree checkout using the destination index view.
.gitattributes along each path are read from prospective_index (and global/info sources),
not from the working tree, so stale on-disk attribute files cannot override the tree being
checked out.
§Errors
Returns I/O errors from loading global attribute sources.
Sourcepub fn filter_process(&self) -> &FilterProcessState
pub fn filter_process(&self) -> &FilterProcessState
Long-running filter-process registry for this repository handle.
Sourcepub fn config_arc(&self) -> Arc<ConfigSet> ⓘ
pub fn config_arc(&self) -> Arc<ConfigSet> ⓘ
Config snapshot as Arc (for diff options that clone options structs).
Sourcepub fn conversion(&self) -> &ConversionConfig
pub fn conversion(&self) -> &ConversionConfig
Line-ending / filter conversion derived from config.
Sourcepub fn ignore(&self) -> Ref<'_, IgnoreMatcher>
pub fn ignore(&self) -> Ref<'_, IgnoreMatcher>
Ignore engine for untracked/ignored walks (check-ignore semantics).
Sourcepub fn ignore_mut(&self) -> RefMut<'_, IgnoreMatcher>
pub fn ignore_mut(&self) -> RefMut<'_, IgnoreMatcher>
Mutable ignore engine (per-directory .gitignore loads are memoized inside).
Sourcepub fn attribute_rules_for_path(&self, rel_path: &str) -> Vec<AttrRule>
pub fn attribute_rules_for_path(&self, rel_path: &str) -> Vec<AttrRule>
Merged .gitattributes rules applying to rel_path (parent directories included).
Sourcepub fn file_attrs(&self, rel_path: &str, is_dir: bool) -> FileAttrs
pub fn file_attrs(&self, rel_path: &str, is_dir: bool) -> FileAttrs
Resolved attributes for rel_path using this context’s config snapshot.