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: boolWhen true, gitlink entries are not dirty solely from untracked files inside the submodule.
simplify_gitlinks: boolWhen true, nested gitlink entries only compare the submodule checkout HEAD to the recorded OID.
error_on_broken_gitlinks: boolWhen 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: boolWhen 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: boolWhen true, omit worktree-vs-index diffs for unmerged paths (used by status only).
refresh_fsmonitor: boolWhen 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: boolWhen 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).