Skip to main content

stamp_context_version

Function stamp_context_version 

Source
pub fn stamp_context_version(
    golden_text: &str,
    sha: &str,
    fallback_dataset: Option<&str>,
) -> Result<String, String>
Expand description

Rewrite a golden YAML’s context_version: line to <dataset>@<sha>, preserving the dataset prefix when the golden already had one (else falling back to fallback_dataset). Line-based so comments and formatting survive. Returns the new document text.