Skip to main content

WorktreeRules

Struct WorktreeRules 

Source
pub struct WorktreeRules { /* private fields */ }
Expand description

Attribute/ignore/conversion state shared across one porcelain operation.

Implementations§

Source§

impl WorktreeRules

Source

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.

Source

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.

Source

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.

Source

pub fn filter_process(&self) -> &FilterProcessState

Long-running filter-process registry for this repository handle.

Source

pub fn config(&self) -> &ConfigSet

Repository config snapshot used to build this context.

Source

pub fn config_arc(&self) -> Arc<ConfigSet> ⓘ

Config snapshot as Arc (for diff options that clone options structs).

Source

pub fn conversion(&self) -> &ConversionConfig

Line-ending / filter conversion derived from config.

Source

pub fn ignore(&self) -> Ref<'_, IgnoreMatcher>

Ignore engine for untracked/ignored walks (check-ignore semantics).

Source

pub fn ignore_mut(&self) -> RefMut<'_, IgnoreMatcher>

Mutable ignore engine (per-directory .gitignore loads are memoized inside).

Source

pub fn attribute_rules_for_path(&self, rel_path: &str) -> Vec<AttrRule>

Merged .gitattributes rules applying to rel_path (parent directories included).

Source

pub fn file_attrs(&self, rel_path: &str, is_dir: bool) -> FileAttrs

Resolved attributes for rel_path using this context’s config snapshot.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.