commit_touches_path

Function commit_touches_path 

Source
pub fn commit_touches_path(
    repo: &Repository,
    commit: &Commit<'_>,
    filter_path: &Path,
) -> GitResult<bool>
Expand description

Check if a commit modifies the specified path.

For root commits (no parents), checks if the path exists in the commit’s tree. For regular commits, diffs against each parent to detect changes. For merge commits with multiple parents, returns true if the path was modified relative to any parent.

Uses zero-allocation iteration over parent IDs and early-exit optimization to minimize overhead in the path filtering hot path.