Skip to main content

Module command_worktree

Module command_worktree 

Source
Expand description

Whether a git worktree invocation changes worktree registrations (an add or a move). What: The one fact the wrapper needs about git worktree: whether the invocation changes worktree registrations. Why: The worktree-copy opt-out is written after git worktree add or git worktree move, so the flag is recognized after that second word; only an add is a source of ignored-state synchronization.

In TS you’d write (pseudocode):

// changesWorktreeRegistrations(['add', '../topic']) === true

Functions§

changes_worktree_registrations
What: Whether the tokens after worktree start with add or move. &[OsString] borrows those tokens; bool is true or false. Why: The caller decides from this alone, without reading the subcommand’s options, so a mistaken option table can never hide a worktree creation.