fix: Prepare error message for --allow-staged

Signed-off-by: Jordan Justen <jljusten@gmail.com>
This commit is contained in:
Jordan Justen 2018-08-20 03:46:29 -07:00
parent 0ec7281b9c
commit 4539ff2191
No known key found for this signature in database
GPG Key ID: 37F99F68CAF992EB
2 changed files with 7 additions and 7 deletions

View File

@ -113,10 +113,10 @@ fn check_version_control(opts: &FixOptions) -> CargoResult<()> {
for file in dirty_files { for file in dirty_files {
files_list.push_str(" * "); files_list.push_str(" * ");
files_list.push_str(&file); files_list.push_str(&file);
files_list.push_str("\n"); files_list.push_str(" (dirty)\n");
} }
bail!("the working directory of this project is detected as dirty, and \ bail!("the working directory of this project has uncommitted changes, and \
`cargo fix` can potentially perform destructive changes; if you'd \ `cargo fix` can potentially perform destructive changes; if you'd \
like to suppress this error pass `--allow-dirty`, or commit the \ like to suppress this error pass `--allow-dirty`, or commit the \
changes to these files:\n\ changes to these files:\n\

View File

@ -785,12 +785,12 @@ fn warns_about_dirty_working_directory() {
execs() execs()
.with_status(101) .with_status(101)
.with_stderr("\ .with_stderr("\
error: the working directory of this project is detected as dirty, and `cargo \ error: the working directory of this project has uncommitted changes, \
fix` can potentially perform destructive changes; if you'd like to \ and `cargo fix` can potentially perform destructive changes; if you'd \
suppress this error pass `--allow-dirty`, or commit the changes to \ like to suppress this error pass `--allow-dirty`, or commit the changes \
these files: to these files:
* src/lib.rs * src/lib.rs (dirty)
") ")