Merge pull request #614 from yuja/push-utqlvwnvuwrl

Fix dir-diff paths merging to not add duplicated entries from remainder
pull/619/head
Wilfred Hughes 2024-01-05 08:47:24 +07:00 committed by GitHub
commit 50a03b4b14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

@ -291,8 +291,18 @@ pub(crate) fn relative_paths_in_either(lhs_dir: &Path, rhs_dir: &Path) -> Vec<Pa
}
}
paths.extend(lhs_paths.into_iter().skip(i));
paths.extend(rhs_paths.into_iter().skip(j));
paths.extend(
lhs_paths[i..]
.iter()
.filter(|&path| !seen.contains(path))
.cloned(),
);
paths.extend(
rhs_paths[j..]
.iter()
.filter(|&path| !seen.contains(path))
.cloned(),
);
paths
}