Skip to main content

Module git

Module git 

Source
Expand description

Lightweight git status check via shell-out.

apply uses this to decide whether to escalate AutoAbsorb to NeedsConfirm when [absorb] require_clean_git = true — pulling target-side edits into a dirty source repo would mix yui’s writes with the user’s in-progress changes in a single commit.

No git crate dependency: shells out to the git CLI. If git isn’t installed or the directory isn’t a repo, callers receive a clear Error::Git and can decide how lenient to be.

Functions§

is_clean
Returns true when the working tree at repo has no uncommitted changes and no untracked files (i.e. git status --porcelain is empty). Err(Error::Git(_)) if git isn’t on $PATH or repo isn’t a repository.