Skip to main content

git_output

Function git_output 

Source
pub fn git_output(args: &[&str]) -> Result<Output>
Expand description

Run a git command and return the raw Output.

Always sets LC_ALL=C. Use when you need to inspect both stdout and stderr, or when the caller has custom status-checking logic.

Args:

  • args: Arguments to pass to git.

Usage:

let output = git_output(&["rev-list", "HEAD~5..HEAD"])?;
if !output.status.success() { /* custom handling */ }