Skip to main content

detect_git_status

Function detect_git_status 

Source
pub fn detect_git_status(root: &Path) -> (Option<String>, usize)
Expand description

Fetch branch and dirty-file count in a single git subprocess.

git status --porcelain=v1 --branch prints one header line (## branch-name...tracking-info or ## HEAD (no branch)) followed by one line per dirty path. Parsing both from one spawn halves the subprocess cost of super::workspace::WorkspaceSnapshot::capture.