Skip to content

caching

Caching operations.

Classes

Functions

clone_repo

clone_repo(url: ParsedURL) -> Path

Clone and cache a Git repository.

Previously cloned repositories are updated unless they point to a specific reference.

PARAMETER DESCRIPTION
url

The URL to the Git repository

TYPE: ParsedURL

RETURNS DESCRIPTION
Path

The full path to the cloned and cached remote repository or the local directory.

get_cache_dir

get_cache_dir() -> Path

Get the path to store cached repos.

RETURNS DESCRIPTION
Path

Path to the cache directory or a temporary directory if caching is disabled.

get_remote_clone

get_remote_clone(parsed_url: ParsedURL) -> Path

Return the path to a locally cloned remote repo.

This provides some error-checking for the cached repo, and will re-clone if the cached repo is in a detached head state.

PARAMETER DESCRIPTION
parsed_url

The parsed Git URL to clone

TYPE: ParsedURL

RETURNS DESCRIPTION
Path

The path to the locally cloned repository