Skip to main content

load_registry

Function load_registry 

Source
pub fn load_registry(
    spec: &RegistrySpec,
    cache_dir: &Path,
    state_file: &Path,
    logger: &dyn LoggerTrait,
) -> Result<RegistryLoadResult, Error>
Expand description

Load registry configuration from the given spec.

Returns both the configuration and the resolved commit hash.

Supports:

  • Local paths (starts with /, ./, ../, or is an existing directory)
    • Loaded directly from disk, no caching or networking
  • Git URLs (anything else — cloned/fetched into the cache)
    • Implements smart-sync (SRS §10.4-10.5):
      • Uses cache if available (no network call)
      • Only fetches if remote has changes or ref is not a version tag
      • Version tags skip fetch entirely (assumed stable)