Skip to main content

inspect

Function inspect 

Source
pub fn inspect(name: &str, path: &Path, fetch: bool) -> RepoStatus
Expand description

Inspect a single registered repository and return its RepoStatus.

This function does not propagate errors via Result. Per the git-status design, the failure surface for an individual repo is per-row — a missing path, a broken .git directory, or a failed fetch all become a populated error field on the returned status, never an aborted batch.

When fetch == true and the repo is in Clean/Dirty state with a resolvable upstream, git2::Remote::fetch is invoked against the upstream remote of the current branch before ahead/behind are computed. Fetch failures populate error and leave ahead/behind reflecting the pre-fetch state.