Skip to main content

check_clean

Function check_clean 

Source
pub fn check_clean(
    context: &GitContext,
    root: &Path,
    git_dir: &Path,
    common_dir: &Path,
) -> Result<CleanSource, CleanRefusal>
Expand description

Cleanliness controls stay out of the release executable. What: Check that the worktree at root, whose Git directory is git_dir and whose shared directory is common_dir, is clean; return what its HEAD names, or the reason it cannot be proven clean. Why: The caller turns a refusal into a quiet fall to the next rung (or to Git’s own removal) and logs the reason.

In TS you’d write (pseudocode):

async function checkClean(args: { context: GitContext; root: string; gitDir: string; commonDir: string }): Promise<CleanSource>; // throws a reason