Skip to main content

list_refs_checked

Function list_refs_checked 

Source
pub fn list_refs_checked(git_dir: &Path) -> Result<Vec<(String, GitHash)>>
Expand description

Like list_refs but fails loud on a ref-enumeration I/O error instead of silently returning fewer refs. A genuine failure to read the refs subsystem (e.g. refs/ present but unreadable, a packed-refs that exists but can’t be read) is a bootstrap failure: callers that compute reachability from these refs (the unreachable-object audit) must NOT treat it as “zero refs” — that would flag every object as orphaned (a false-positive inversion). A genuinely absent file/dir (NotFound) is the legitimate empty case and is NOT an error.

§Errors

GitError::Io if a refs path that exists cannot be enumerated/read.