Skip to main content

git_rev_parse

Function git_rev_parse 

Source
pub fn git_rev_parse(args: &[&str]) -> Option<PathBuf>
Expand description

Run git rev-parse with the given arguments and return the output as a path.

Returns None if git is not available, the command fails, or the output is empty.

Strips inherited GIT_* routing vars before spawning so the git invocation resolves the repository from its own cwd/args, not from the parent hook or CI environment. See nb-api:issues/3.