Skip to content

Commit cc3b6cb

Browse files
committed
fix(package): sort dirty file report
To make error message more deterministic
1 parent 59b2ddd commit cc3b6cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cargo/ops/cargo_package.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ fn check_repo_state(
824824
// Find the intersection of dirty in git, and the src_files that would
825825
// be packaged. This is a lazy n^2 check, but seems fine with
826826
// thousands of files.
827-
let dirty_src_files: Vec<String> = src_files
827+
let mut dirty_src_files: Vec<_> = src_files
828828
.iter()
829829
.filter(|src_file| dirty_files.iter().any(|path| src_file.starts_with(path)))
830830
.map(|path| {
@@ -847,6 +847,7 @@ fn check_repo_state(
847847
dirty,
848848
}))
849849
} else {
850+
dirty_src_files.sort_unstable();
850851
anyhow::bail!(
851852
"{} files in the working directory contain changes that were \
852853
not yet committed into git:\n\n{}\n\n\

0 commit comments

Comments
 (0)