Skip to main content

resolve_git_ref

Function resolve_git_ref 

Source
pub fn resolve_git_ref(project_root: &Path, git_ref: &str) -> Result<String>
Expand description

Resolve a git ref (e.g. “HEAD”, “main”, “origin/main”) to a full commit hash.

Runs git rev-parse <ref> in the project directory. Returns an error if git is not available or the ref cannot be resolved.