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.
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.
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.
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.
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.
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 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 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).
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.
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.
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.
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.
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).
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.