Skip to main content

DiffIndexToWorktreeOptions

Struct DiffIndexToWorktreeOptions 

Source
pub struct DiffIndexToWorktreeOptions {
Show 17 fields pub index_mtime: Option<(u32, u32)>, pub ignore_submodule_untracked: bool, pub simplify_gitlinks: bool, pub error_on_broken_gitlinks: bool, pub repository_git_dir: Option<PathBuf>, pub refresh_index_stat_in_pass: bool, pub config: Option<Arc<ConfigSet>>, pub stat_parallel_threads: Option<usize>, pub thread_policy: Option<ThreadPolicy>, pub worktree_rules: Option<Arc<Mutex<WorktreeRules>>>, pub for_status: bool, pub refresh_fsmonitor: bool, pub command_runner: Option<Arc<dyn CommandRunner>>, pub fsmonitor_query_boundary: Option<FsmonitorQueryBoundary>, pub restrict_to_paths: Option<Arc<BTreeSet<String>>>, pub hash_blobs_without_write: bool, pub cancel_watch: Option<Arc<AtomicBool>>,
}
Expand description

Additional inputs for diff_index_to_worktree_with_options.

Fields§

§index_mtime: Option<(u32, u32)>

Optional index mtime pair (sec, nsec) sampled when the index was read.

When provided, entries with matching stat data are still considered dirty candidates if their recorded mtime is “racy” (at or after this timestamp), matching Git’s is_racy_timestamp behavior.

§ignore_submodule_untracked: bool

When true, gitlink entries are not dirty solely from untracked files inside the submodule.

§simplify_gitlinks: bool

When true, nested gitlink entries only compare the submodule checkout HEAD to the recorded OID.

§error_on_broken_gitlinks: bool

When true, a populated gitlink checkout whose .git indirection cannot resolve to a HEAD is returned as an error instead of a normal modified gitlink.

§repository_git_dir: Option<PathBuf>

Repository git directory used to load config (separate git dir / linked worktrees).

When unset, defaults to work_tree/.git, which is wrong for gitfile layouts.

§refresh_index_stat_in_pass: bool

When true, adopt refreshed stat data for unchanged blobs during the same directory scan as the worktree diff (one lstat per tracked path).

§config: Option<Arc<ConfigSet>>

When set, used instead of loading config from Self::repository_git_dir.

§stat_parallel_threads: Option<usize>

Cap parallel stat workers (Some(1) forces serial), also applied to hashing the racily clean entries the stat refresh verifies. When None, honors core.preloadIndex and crate::worktree_scan::PARALLEL_STAT_MIN_ENTRIES.

§thread_policy: Option<ThreadPolicy>

CLI / embedder thread override applied to stat preload and hashing in this diff.

§worktree_rules: Option<Arc<Mutex<WorktreeRules>>>

Shared per-operation attribute/conversion context (see crate::worktree_rules::WorktreeRules).

§for_status: bool

When true, omit worktree-vs-index diffs for unmerged paths (used by status only).

§refresh_fsmonitor: bool

When true (default), query core.fsmonitor before scanning the worktree.

§command_runner: Option<Arc<dyn CommandRunner>>

Injectable subprocess runner for fsmonitor hooks; defaults to the system runner.

§fsmonitor_query_boundary: Option<FsmonitorQueryBoundary>

When set, used as the hook protocol v1 query boundary; otherwise crate::environment::wall_clock_unix_timestamp_nanos is sampled once per diff.

§restrict_to_paths: Option<Arc<BTreeSet<String>>>

When set, only index paths in this set are compared against the work tree.

Used by branch switch to verify dirty paths only where the tree-to-tree diff would update the worktree, avoiding a full tracked scan on large indexes. Callers must refuse the operation when the index has unmerged entries; this filter does not substitute for a full unmerged scan.

§hash_blobs_without_write: bool

When true with staging materialization, compute blob OIDs without writing loose objects.

§cancel_watch: Option<Arc<AtomicBool>>

When set, long loops abort with crate::error::Error::Cancelled once the flag is raised (see crate::progress::cancel_watch_arc and crate::progress::poll_cancel_watch).

Trait Implementations§

Source§

impl Clone for DiffIndexToWorktreeOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for DiffIndexToWorktreeOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.