Skip to main content

cache_path_with_root

Function cache_path_with_root 

pub fn cache_path_with_root(
    key: &[u8; 32],
    repo_path: &Path,
    root: &Path,
) -> PathBuf
Expand description

Same as cache_path but with an explicit root (for --cache-dir override).

repo_path is canonicalised before hashing the per-repo subdirectory name so this function and cache_key (which already canonicalises) stay in lockstep: codelore analyze . and codelore analyze $(pwd) name one repository, so they must resolve to one cache file. Holding that property takes agreement on both halves of the path — the directory here, and the key itself, which is why Options::repo_path is excluded from the options hash rather than riding into it as the user happened to spell it.