]> git.proxmox.com Git - cargo.git/commit
fix(add): Update the lock file
authorEd Page <eopage@gmail.com>
Mon, 25 Jul 2022 15:11:50 +0000 (10:11 -0500)
committerEd Page <eopage@gmail.com>
Tue, 26 Jul 2022 19:59:07 +0000 (14:59 -0500)
commit5789c12e45c8ba5111eda6c8562b881ced867b0d
tree25e15e6f7e9e18650a9139a87e504458347e5e81
parent323c7bc3069139727e49347b3663e30634057779
fix(add): Update the lock file

This is done in the command, rather than in the op,
- To consistently construct the `Workspace`
- It is more composable as an API

A downside is we update the git dependencies a second time.

We are not rolling back on error.
- For some errors, the user might want to debug what went wrong
- Rollback adds its own complications and risks, including since its
  non-atomic

Fixes #10901
23 files changed:
src/bin/cargo/commands/add.rs
tests/testsuite/cargo_add/git/stderr.log
tests/testsuite/cargo_add/git_branch/stderr.log
tests/testsuite/cargo_add/git_dev/stderr.log
tests/testsuite/cargo_add/git_inferred_name/stderr.log
tests/testsuite/cargo_add/git_multiple_names/stderr.log
tests/testsuite/cargo_add/git_registry/mod.rs
tests/testsuite/cargo_add/git_registry/stderr.log
tests/testsuite/cargo_add/git_rev/stderr.log
tests/testsuite/cargo_add/git_tag/stderr.log
tests/testsuite/cargo_add/list_features_path/stderr.log
tests/testsuite/cargo_add/list_features_path_no_default/stderr.log
tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/in/Cargo.toml [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/in/src/lib.rs [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/mod.rs [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/out/Cargo.toml [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/stderr.log [new file with mode: 0644]
tests/testsuite/cargo_add/lockfile_updated/stdout.log [new file with mode: 0644]
tests/testsuite/cargo_add/mod.rs
tests/testsuite/cargo_add/overwrite_version_with_git/stderr.log