Skip to main content

load_gitattributes_for_diff

Function load_gitattributes_for_diff 

Source
pub fn load_gitattributes_for_diff(
    repo: &Repository,
) -> Result<ParsedGitAttributes, Error>
Expand description

Load merged .gitattributes rules for diff and merge (respects GIT_ATTR_SOURCE / attr.tree).

Resolution order matches Git’s attribute source for diff: optional tree from resolve_attr_treeish, then work tree stack (or bare info/attributes only).

§Errors

Returns an error when a tree-ish source is set from the environment or command line and cannot be resolved (Git: “bad –attr-source or GIT_ATTR_SOURCE”).