Skip to main content

Crate sley_worktree

Crate sley_worktree 

Source

Structs§

ApplySparseResult
AtomicMetadataWriteOptions
AtomicMetadataWriteResult
AttributeCheck
CacheInfoEntry
CheckoutResult
EolInfo
The three ls-files --eol fields for a single path.
IgnoreMatch
IndexStatProbe
Stage-0 index stat data that can prove a worktree path clean without re-reading and re-hashing it.
IndexStatProbeCache
Reusable stage-0 index stat probes for many worktree paths.
MoveDetail
MoveOptions
MoveResult
PathspecMatchMagic
Pathspec match magic, mirroring git’s PATHSPEC_LITERAL/PATHSPEC_GLOB/ PATHSPEC_ICASE. Constructed from the global --{glob,noglob,icase,literal}-pathspecs options. Drives pathspec_item_matches.
RemoveOptions
RemoveResult
RestoreResult
ShortStatusEntry
ShortStatusOptions
SparseCheckout
StandardAttributeMatcher
A reusable matcher for standard worktree attributes (global or core.attributesFile, every in-tree .gitattributes, and $GIT_DIR/info/attributes).
SubmoduleStatus
Submodule-specific change detail for a status entry, mirroring upstream’s wt_status_change_data trio: new_submodule_commits plus the DIRTY_SUBMODULE_MODIFIED/DIRTY_SUBMODULE_UNTRACKED dirty bits.
TreeAttributes
A reusable handle that captures a tree’s .gitattributes chain once so repeated smudge-filter calls (e.g. git archive streaming every blob in a tree) resolve attributes from the tree being processed rather than the live worktree.
UntrackedPathOptions
UntrackedPathspecFilter
Pathspec filter for untracked collection. Mirrors git ls-files pathspec semantics: literal paths, recursive directory prefixes, and fnmatch globs.
UpdateIndexOptions
UpdateIndexPath
A single positional path passed to update-index, together with the --chmod state that was active at the point the path was seen on the command line. git applies --chmod=(+|-)x as a stateful flag that affects every subsequent path until overridden, so --chmod=+x A --chmod=-x B flips A executable and B non-executable. Each path also reports its action (add '<p>', remove '<p>', chmod (+|-)x '<p>') inline under --verbose, interleaved in command-line order — which is why the chmod state must travel with the path rather than as a single batch-wide flag.
UpdateIndexResult
WorktreeAttributes
A reusable handle that captures the worktree’s .gitattributes chain once so repeated clean-filter calls (e.g. hash-object --stdin-paths hashing many paths in one process) don’t re-walk the worktree and re-read every .gitattributes/global config per path.
WriteTreeOptions

Enums§

AttributeState
IndexInfoRecord
SparseCheckoutMode
Selects how the patterns in a SparseCheckout are interpreted when deciding which index paths are “in cone” (kept in the worktree).
StatusUntrackedMode
WorktreeEntryState
The worktree state of one tracked path relative to an expected index/tree entry.
WorktreeStatus

Constants§

DIRTY_SUBMODULE_MODIFIED
Bit set in a submodule dirt mask when the submodule has staged or unstaged changes to tracked files (upstream DIRTY_SUBMODULE_MODIFIED).
DIRTY_SUBMODULE_UNTRACKED
Bit set in a submodule dirt mask when the submodule has untracked files (upstream DIRTY_SUBMODULE_UNTRACKED).
WM_CASEFOLD
Case-insensitive match flag (git WM_CASEFOLD).
WM_PATHNAME
Pathname-aware match flag (git WM_PATHNAME): */? do not cross /, ** is required to span directory separators.

Traits§

WorktreeScanner

Functions§

add_paths_to_index
add_paths_to_index_filtered
Like add_paths_to_index, but runs the configured content filters (core.autocrlf/text/eol EOL conversion and filter.<name>.clean drivers) on each file’s contents before hashing it into the object store.
apply_clean_filter
Apply the clean conversion to content for path (worktree -> blob): first the configured filter.<name>.clean driver (if any), then CRLF->LF normalization when EOL conversion applies.
apply_clean_filter_with_attributes
Like apply_clean_filter but takes already-resolved attribute checks, letting callers that have computed attributes once reuse them.
apply_clean_filter_with_attributes_cow
Borrow-first variant of apply_clean_filter_with_attributes.
apply_smudge_filter
Apply the smudge conversion to content for path (blob -> worktree): first LF->CRLF when EOL conversion applies, then the configured filter.<name>.smudge driver (if any).
apply_smudge_filter_with_attributes
Like apply_smudge_filter but takes already-resolved attribute checks.
apply_smudge_filter_with_attributes_cow
Borrow-first variant of apply_smudge_filter_with_attributes.
apply_sparse_checkout
Enforces a SparseCheckout against the current index and worktree.
apply_sparse_checkout_with_mode
Like apply_sparse_checkout but lets the caller force the pattern interpretation instead of auto-detecting it.
checkout_branch
checkout_branch_filtered
Like checkout_branch, but runs the smudge-side content filters (core.autocrlf/text/eol EOL conversion and filter.<name>.smudge drivers) on each blob as it is written to the worktree. config is the repository config used to resolve the filters.
checkout_detached
checkout_detached_filtered
Like checkout_detached, but runs the smudge-side content filters (see checkout_branch_filtered).
checkout_detached_sparse
Checks out target like checkout_detached, but materializes the worktree through the supplied SparseCheckout: out-of-cone paths are not written, get their skip-worktree bit set, and have any stale worktree file removed. Existing public checkout entry points are unchanged; this is an additive sparse-aware variant.
checkout_tree_to_index_and_worktree
Materialize a tree object into the index and worktree.
deleted_index_entries
eol_attribute_checks
Resolve the crlf/eol/text/filter attributes for path from the worktree .gitattributes chain (the set ls-files --eol needs for its attr/ field).
eol_info_for_path
Compute the ls-files --eol info for path.
force_write_index
ignored_index_entries
index_from_tree
Build a fresh in-memory index that mirrors the tree tree_oid, the way git read-tree <tree> does: every blob, symlink, and gitlink leaf (found by recursing subtrees) becomes a stage-0 entry carrying the tree mode and oid, with a fully zeroed stat (so nothing is treated as stat-clean) and size 0. Entries are sorted by path; the index is version 2 with no extensions.
is_shallow_repository
Whether the repository at git_dir is shallow — i.e. it has a shallow file recording grafted commit boundaries (git clone --depth).
modified_index_entries
move_index_and_worktree_path
path_matches_ignore
path_matches_ignore_with_per_directory
path_matches_standard_ignore
pathspec_is_glob
True if path contains a glob-special character.
pathspec_item_matches
Port of git’s match_pathspec_item for the single-pathspec / single-name case (no prefix, no attr magic). match_ is the pathspec, name is the candidate path. Returns whether the pathspec selects name (exactly, as a directory prefix, or via wildmatch). Byte-for-byte faithful to git 2.54 for the ls-files -- <pathspec> path that t3070 exercises.
read_repository_index
refresh_index_paths
remove_index_and_worktree_paths
repository_index_path
reset_index_and_worktree_to_commit
reset_index_to_commit
restore_index_and_worktree_paths_from_head
restore_index_and_worktree_paths_from_tree
restore_index_paths_from_head
restore_index_paths_from_tree
restore_worktree_paths
restore_worktree_paths_filtered
Like restore_worktree_paths, applying the smudge-side content filters (CRLF / ident / filter drivers) the way a checkout writes blobs.
restore_worktree_paths_from_head
restore_worktree_paths_from_tree
set_index_assume_unchanged_paths
set_index_fsmonitor_valid_paths
set_index_skip_worktree_paths
set_index_version
short_status
short_status_with_options
standard_attributes_for_path
standard_attributes_for_path_from_index
standard_attributes_for_path_from_tree
standard_ignore_match
submodule_dirt
Inspect the working state of the submodule whose worktree is at sub_root and report its dirt mask: DIRTY_SUBMODULE_MODIFIED for staged/unstaged changes to tracked files, DIRTY_SUBMODULE_UNTRACKED for untracked files. Returns 0 for a clean submodule — and for a directory that is not a populated repository at all (upstream treats an unpopulated gitlink as always unchanged). The native equivalent of upstream’s is_submodule_modified() (which runs git status --porcelain=2 inside the submodule and classifies ? lines as untracked, everything else as modified).
untracked_paths
untracked_paths_with_options
untracked_pathspec_matches
Whether path matches an ls-files pathspec (literal, directory prefix, or glob).
untracked_pathspec_needs_descent
Whether a directory walk must descend into parent to satisfy active pathspecs.
update_index_again
update_index_cacheinfo
update_index_index_info
update_index_ordered_paths_filtered
Stage an ordered list of paths, each carrying its own --chmod state, and (under verbose) print the add/remove/chmod action lines inline in command-line order. This is the entry point git update-index <path>... uses so that --chmod=+x A --chmod=-x B --verbose produces the interleaved add 'A' / chmod +x 'A' / add 'B' / chmod -x 'B' output git emits.
update_index_paths
update_index_paths_filtered
Like update_index_paths, but applies the clean-side content filters (see apply_clean_filter) to file contents before they are hashed/written.
wildmatch
Match pattern against text with git’s wildmatch semantics. flags is a bitwise-OR of WM_CASEFOLD and WM_PATHNAME.
worktree_entry_state
Compare one expected tracked entry to the worktree path named by path.
worktree_entry_state_by_git_path
Compare one expected tracked entry to the worktree path named by a repository-relative git path (/ separators, raw bytes).
worktree_root_for_git_dir
Resolve the working-tree root for a repository identified by its git directory, returning Ok(None) for a bare repository.
write_metadata_file_atomic
Write a git metadata file through a sibling .lock file and atomic rename.
write_tree_from_index
write_tree_from_index_with_options