Skip to content

Commit 048d21d

Browse files
committed
fix(lock): Formulate the --locked suggestion with more direct wording
1 parent a74cff7 commit 048d21d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/cargo/ops/lockfile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn write_pkg_lockfile(ws: &Workspace<'_>, resolve: &mut Resolve) -> CargoRes
5555
if let Some(locked_flag) = ws.gctx().locked_flag() {
5656
anyhow::bail!(
5757
"the lock file {} needs to be updated but {} was passed to prevent this\n\
58-
If you want to try to generate the lock file without accessing the network, \
58+
help: to generate the lock file without accessing the network, \
5959
remove the {} flag and use --offline instead.",
6060
lock_root.as_path_unlocked().join(LOCKFILE_NAME).display(),
6161
locked_flag,

tests/testsuite/lockfile_compat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ fn locked_correct_error() {
518518
.with_stderr_data(str![[r#"
519519
[UPDATING] `dummy-registry` index
520520
[ERROR] the lock file [ROOT]/foo/Cargo.lock needs to be updated but --locked was passed to prevent this
521-
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
521+
[HELP] to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
522522
523523
"#]])
524524
.run();

tests/testsuite/offline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ fn offline_and_frozen_and_no_lock() {
768768
.with_status(101)
769769
.with_stderr_data(str![[r#"
770770
[ERROR] the lock file [ROOT]/foo/Cargo.lock needs to be updated but --frozen was passed to prevent this
771-
If you want to try to generate the lock file without accessing the network, remove the --frozen flag and use --offline instead.
771+
[HELP] to generate the lock file without accessing the network, remove the --frozen flag and use --offline instead.
772772
773773
"#]])
774774
.run();
@@ -781,7 +781,7 @@ fn offline_and_locked_and_no_frozen() {
781781
.with_status(101)
782782
.with_stderr_data(str![[r#"
783783
[ERROR] the lock file [ROOT]/foo/Cargo.lock needs to be updated but --locked was passed to prevent this
784-
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
784+
[HELP] to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
785785
786786
"#]])
787787
.run();

0 commit comments

Comments
 (0)