pub fn diff_trees(old_tree: &FileTree, new_tree: &FileTree) -> Vec<DiffEntry>Expand description
Compute the diff between two FileTrees.
Returns a list of DiffEntry describing all changes. The entries are sorted by path for deterministic output.
§Algorithm
- Files only in
old_tree→ Deleted - Files only in
new_tree→ Added - Files in both with same hash → Unchanged (omitted)
- Files in both with different hash → Modified
- Heuristic rename detection: a deleted file whose hash matches an added file is reported as a rename.