diff --git a/src/cargo/ops/common_for_install_and_uninstall.rs b/src/cargo/ops/common_for_install_and_uninstall.rs index b6f53a83f64..444e57cfddb 100644 --- a/src/cargo/ops/common_for_install_and_uninstall.rs +++ b/src/cargo/ops/common_for_install_and_uninstall.rs @@ -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()) diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index e8891e21b2a..c2d3eef6fe4 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -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();