Skip to main content

new_temp_composefs_repo

Function new_temp_composefs_repo 

Source
pub(crate) fn new_temp_composefs_repo(
    erofs_version: FormatVersion,
) -> Result<(TempDir, Arc<Repository<Sha512HashValue>>)>
Expand description

Creates a temporary composefs repository for computing digests.

The erofs_version controls which EROFS format the digest is computed for: use FormatVersion::V1 to get a composefs.digest=v1-sha512-12:<hex> karg (V1 EROFS, C-tool compatible) or FormatVersion::V2 for the legacy composefs=<hex> karg.

Returns the TempDir guard (must be kept alive for the repo to remain valid) and the repository wrapped in Arc.