Skip to content

Add more details for installing git repository errors #9582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cargo/ops/common_for_install_and_uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,9 @@ where
fn multi_err(kind: &str, mut pkgs: Vec<&Package>) -> String {
pkgs.sort_unstable_by_key(|a| a.name());
format!(
"multiple packages with {} found: {}",
"multiple packages with {} found: {}. When installing a git repository, \
cargo will always search the entire repo for any Cargo.toml. \
Please specify which to install.",
kind,
pkgs.iter()
.map(|p| p.name().as_str())
Expand Down
4 changes: 3 additions & 1 deletion tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ fn multiple_crates_error() {
.with_stderr(
"\
[UPDATING] git repository [..]
[ERROR] multiple packages with binaries found: bar, foo
[ERROR] multiple packages with binaries found: bar, foo. \
When installing a git repository, cargo will always search the entire repo for any Cargo.toml. \
Please specify which to install.
",
)
.run();
Expand Down