diff --git a/src/shared/local/moveDetection.ts b/src/shared/local/moveDetection.ts index b6d84842..a2a58d15 100644 --- a/src/shared/local/moveDetection.ts +++ b/src/shared/local/moveDetection.ts @@ -62,6 +62,7 @@ export const getMatches = (status: StatusRow[]): AddedAndDeletedFilenames => { const addedBasenames = new Set(addedFilenames.map((filename) => path.basename(filename))); const deletedBasenames = new Set(deletedFilenames.map((filename) => path.basename(filename))); + // TODO: when node 22 is everywhere, we can use Set.prototype.intersection // Again, we filter over the deleted files first and exit early if there are no filename matches const deletedFilenamesWithMatches = new Set(deletedFilenames.filter((f) => addedBasenames.has(path.basename(f)))); if (!deletedFilenamesWithMatches.size) return emptyResult;