pub fn run_with_worktree_copy(
invocation: &Invocation,
run_git: &mut GitRunner<'_>,
identity_after_lock: &mut dyn FnMut() -> Result<WorktreeIdentity, WorktreeCopyError>,
stderr: &mut dyn Write,
) -> Result<Settlement, WorktreeCopyError>Expand description
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.
In TS you’d write (pseudocode):
await runGitWithWorktreeCopy({ args, gitPath, identity, command, environment });