fetch_version_for_prefix

Function fetch_version_for_prefix 

Source
pub fn fetch_version_for_prefix(
    client: &Client,
    prefix: &str,
    cli_label: &str,
) -> Result<String>
Expand description

Resolve the highest version matching a prefix.

E.g., “6.12” → “6.12.81”, “6” → “6.19.12” (highest 6.x.y).

Scans all monikers in releases.json except linux-next. On no active match (an EOL or unreleased series, absent from releases.json), resolves the highest vX.Y.z stable patch from the gregkh mirror’s git tags; if the series has NO stable point release yet (only a base tag), falls back to the bare {prefix} mainline base — see latest_patch_from_git_tags.

When client is the process-wide shared_client singleton, routes through RELEASES_CACHE; other clients bypass the cache via pointer-equality and exercise fetch_releases directly — see cached_releases_with for details. Cache scope is releases.json only; the EOL-series git-tag fallback in latest_patch_from_git_tags always hits the network.

cli_label prefixes diagnostic status output (e.g. "ktstr" or "cargo ktstr").