Expand description
The linked-worktree ignored-state copy around one forwarded Git invocation: the integrator’s entry point. What: The linked-worktree ignored-state copy around one forwarded Git invocation: the public entry point the integrator calls, the settlement and summary it writes, and the exit status it returns. Why: A worktree that Git creates (or a bare repository’s) needs its ignored files from the source worktree, copied under one settlement lock per repository and recovered first when an earlier copy was interrupted.
Integrator contract:
The caller decides the bypass facts (--no-worktree-copy, short-circuit global help or version, whether the
command creates or moves worktrees after alias resolution) with the native modules that already own them,
passes the repository identity and the effective working directory, and supplies the runner that starts real Git
with the lease token in its environment. This module never runs the commit refusal; it is not wired yet.
A main-checkout source is a bypass unless the caller also names Invocation::main_checkout_paths (the configured
forbidden-strings rules file); then only those paths are copied, and only when Git ignores them.
In TS you’d write (pseudocode):
await runGitWithWorktreeCopy({ args, gitPath, identity, command, environment });Structs§
- GitStatus
- What: How a real Git run ended. Why: Its numeric status is the exit status the wrapper keeps; a signal has none.
- Invocation
- What: Everything the lifecycle needs to decide how one invocation is settled. Why: The decisions that depend on argv and global options are made by their owners and passed in as facts.
- Settlement
- What: The result of one settled invocation: Git’s status and the copy failure, if any. Why: Both facts decide the exit status, so they travel together.
Functions§
- exit_
code - What: The exit status of a settled invocation. Why: A copy-only failure is 2; Git’s own status is kept when Git failed; a signal without a status is 1.
- run_
with_ worktree_ copy - What:
Settles one forwarded invocation: bypasses forward untouched; applicable creating commands run under the settlement lock;
other commands only recover pending journals, and only when one exists.
Why:
The integrator calls this once per forwarded command and turns the settlement into the exit status with
exit_code. - summary_
line - What: The one summary line a successful copy writes. Why: Users and agents read the count, the source, and the destination count from it.
Type Aliases§
- GitRunner
- Runs real Git once, with the given lease token (absent when the run inherits none).