Skip to main content

git_command

Function git_command 

Source
pub fn git_command(args: &[&str]) -> Command
Expand description

Build a git command with LC_ALL=C pre-set.

Callers can chain additional configuration (.current_dir(), .stdin(), etc.) before calling .output() or .status().

Args:

  • args: Arguments to pass to git.

Usage:

let output = git_command(&["rev-parse", "HEAD"]).output()?;
let output = git_command(&["log", "--oneline"]).current_dir(&repo).output()?;