Skip to content

Commit 108b05a

Browse files
committed
fix(add): Also respect --frozen for preventing edits
1 parent 40d6ac6 commit 108b05a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cargo/ops/cargo_add/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ pub fn add(workspace: &Workspace<'_>, options: &AddOptions<'_>) -> CargoResult<(
251251
}
252252
}
253253

254-
if options.gctx.locked() {
254+
if let Some(locked_flag) = options.gctx.locked_flag() {
255255
let new_raw_manifest = manifest.to_string();
256256
if original_raw_manifest != new_raw_manifest {
257257
anyhow::bail!(
258-
"the manifest file {} needs to be updated but --locked was passed to prevent this",
258+
"the manifest file {} needs to be updated but {locked_flag} was passed to prevent this",
259259
manifest.path.display()
260260
);
261261
}

0 commit comments

Comments
 (0)