Skip to main content

scripted_fixture_read_only_with_git_version

Function scripted_fixture_read_only_with_git_version 

Source
pub fn scripted_fixture_read_only_with_git_version(
    script_name: impl AsRef<Path>,
    is_git_version_compatible: impl FnOnce((u8, u8, u8)) -> bool,
) -> Result<Option<PathBuf>>
Expand description

Produce a read-only scripted fixture when the installed Git version is compatible, or extract it from a matching archive otherwise.

is_git_version_compatible receives GIT_VERSION. If it returns true, this behaves like scripted_fixture_read_only(). Otherwise, GIX_TEST_IGNORE_ARCHIVES is ignored and the fixture is only made available by extracting an archive whose identity matches the fixture script. The script is never run with an incompatible Git version, and None is returned if no matching archive is available.