Skip to main content

source_refusal

Function source_refusal 

Source
pub fn source_refusal(
    context: &GitContext,
    identity: &WorktreeIdentity,
) -> Result<SnapshotSource, Refusal>
Expand description

What: Check the creating worktree for everything a copy of its files needs, from the cheapest check to the dearest, and collect what the later steps use; the refusal is the error. Why: The dear checks (the clean check starts one Git run) happen once for both rungs, and only after a cheap check let a rung through. The kind of the refusal lets the ladder tell the person the cause in fitting words.

In TS you’d write (pseudocode):

async function sourceRefusal(context: GitContext, identity: WorktreeIdentity): Promise<SnapshotSource>; // throws a Refusal