Skip to main content

diff_sorted

Function diff_sorted 

Source
pub fn diff_sorted(old: &[FlatEntry], new: &[FlatEntry]) -> Option<Vec<Change>>
Expand description

What: The changes from old to new, both sorted by path; None when a path is a file on one side and a directory on the other or when a gitlink is involved. Why: Those are the cases whose ordering or spelling Git decides by more than the lists.

In TS you’d write (pseudocode):

function diffSorted(oldList: FlatEntry[], newList: FlatEntry[]): Change[] | undefined;