resource_cache

Function resource_cache 

Source
pub fn resource_cache(
    repo: &Repository,
    mode: Mode,
    attr_stack: Stack,
    roots: WorktreeRoots,
) -> Result<Platform, Error>
Available on crate feature blob-diff only.
Expand description

Return a low-level utility to efficiently prepare a blob-level diff operation between two resources, and cache these diffable versions so that matrix-like MxN diffs are efficient.

repo is used to obtain the needed configuration values. mode determines how the diffable files will look like, and also how fast, in average, these conversions are. attr_stack is for accessing .gitattributes for knowing how to apply filters. Know that it’s typically adjusted based on the roots - if there are no worktree roots, .gitattributes are also not usually read from worktrees. roots provide information about where to get diffable data from, so source and destination can either be sourced from a worktree, or from the object database, or both.