Skip to content

Commit 1bcf7f1

Browse files
author
Alex Helfet
committed
Fix.
1 parent f299d1c commit 1bcf7f1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/cargo/ops/cargo_generate_lockfile.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ pub fn update_lockfile(ws: &Workspace<'_>, opts: &UpdateOptions<'_>) -> CargoRes
4646

4747
let previous_resolve = match ops::load_pkg_lockfile(ws)? {
4848
Some(resolve) => resolve,
49-
None => return generate_lockfile(ws),
49+
None => {
50+
generate_lockfile(ws)?;
51+
match opts.precise {
52+
None => return Ok(()),
53+
54+
// Precise option specified, so re-run to do the rest of the update.
55+
Some(_) => return update_lockfile(ws, opts)
56+
}
57+
}
5058
};
5159
let mut registry = PackageRegistry::new(opts.config)?;
5260
let mut to_avoid = HashSet::new();

tests/testsuite/update.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ fn update_precise_first_run() {
423423
.with_stderr(
424424
"\
425425
[UPDATING] `[..]` index
426+
[UPDATING] serde v0.2.1 -> v0.2.0
426427
",
427428
)
428429
.run();

0 commit comments

Comments
 (0)