Skip to main content

run_ensure_repository

Function run_ensure_repository 

Source
pub(crate) fn run_ensure_repository(
    path: &Path,
    algorithm: Algorithm,
    insecure: bool,
    erofs_formats: Option<FormatConfig>,
) -> Result<EnsureStatus>
Expand description

Ensure a repository exists at path: create parent directories, then delegate to [Repository::ensure_path]. Unlike run_init_repository, this never bails when a repository already exists with a different on-disk configuration (e.g. EROFS format version) — the existing repository is simply opened as-is. erofs_formats, if given, is only applied when a brand-new repository is created; it has no effect when an existing repository is opened or an old-format one is upgraded.