Skip to main content

load_gitattributes_for_tree_path

Function load_gitattributes_for_tree_path 

Source
pub fn load_gitattributes_for_tree_path(
    odb: &Odb,
    tree_oid: &ObjectId,
    rel_path: &str,
) -> Vec<AttrRule>
Expand description

Load .gitattributes rules from tree_oid that can apply to rel_path.

odb supplies tree and blob objects, tree_oid is the root tree to read, and rel_path is the repository-relative path being matched.

Returns rules in root-to-leaf order. Missing, non-blob, or invalid UTF-8 .gitattributes entries are ignored, matching the best-effort behavior of the worktree loader.