Expand description
git rev-parse — pick out and massage parameters.
rev-parse is the swiss army knife of git plumbing: resolve refs to SHAs,
query the .git directory, show the top-level, check whether the cwd is
inside a working tree, etc. This wrapper exposes the common modes and
returns stdout trimmed as String so callers can parse as needed.
use git_spawn::{GitCommand, RevParseCommand};
let mut cmd = RevParseCommand::new();
cmd.arg_str("HEAD").current_dir("/some/repo");
let sha = cmd.execute().await?;
println!("HEAD -> {sha}");Structs§
- RevParse
Command - Builder for
git rev-parse.