cargo/crates/resolver-tests
bors e08a81333c Auto merge of #13281 - LuuuXXX:issue-10729, r=epage
fix(add): Improve error when adding registry packages while vendored

### **What does this PR try to resolve?**

When a vendored directory is established, cargo add no longer adds new packages. Instead, it tries to translate a package name into a package that already exists in the vendored directory.
[More details](https://github.com/rust-lang/cargo/issues/10729#issue-1260548746)

Since `@epage` has done most of the work, here I do the rest of the finishing work.

Improves the error from #10729

### **How should we test and review this PR?**

The implementation procedure is as follows:
https://github.com/rust-lang/cargo/issues/10729#issuecomment-1191633351

Test steps:
1. Try to get an arbitrary crate and execute `cargo vendor` command.
2. Configure the vendor directory in .cargo/config.toml.
3. Add `alter-registry` to the config.toml file.
```
[registries]
alter-registry= { index = "XXX" }
```
4. run the same `cargo add` command.
```
cargo add another-crate --registry alter-registry
```
2024-02-22 17:28:17 +00:00
..
src Auto merge of #13281 - LuuuXXX:issue-10729, r=epage 2024-02-22 17:28:17 +00:00
tests chore: Rename Config to GlobalContext 2024-02-20 11:55:15 -07:00
Cargo.toml chore: Remove rust-version from private packages 2024-01-18 15:24:25 -06:00