Skip to content

Commit 494fdab

Browse files
committed
If creating a new GitSource, updating it is required before querying it
1 parent 57ac392 commit 494fdab

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/cargo/ops/cargo_install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn install_one(
169169
krate,
170170
vers,
171171
config,
172-
is_first_install,
172+
true,
173173
&mut |git| git.read_packages(),
174174
)?
175175
} else if source_id.is_path() {

tests/testsuite/install.rs

+16
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,22 @@ fn multiple_crates_select() {
283283
assert_has_installed_exe(cargo_home(), "bar");
284284
}
285285

286+
#[test]
287+
fn multiple_crates_git_all() {
288+
let p = git::repo(&paths::root().join("foo"))
289+
.file("Cargo.toml", r#"\
290+
[workspace]
291+
members = ["bin1", "bin2"]
292+
"#)
293+
.file("bin1/Cargo.toml", &basic_manifest("bin1", "0.1.0"))
294+
.file("bin2/Cargo.toml", &basic_manifest("bin2", "0.1.0"))
295+
.file("bin1/src/main.rs", r#"fn main() { println!("Hello, world!"); }"#)
296+
.file("bin2/src/main.rs", r#"fn main() { println!("Hello, world!"); }"#)
297+
.build();
298+
299+
cargo_process(&format!("install --git {} bin1 bin2", p.url().to_string())).run();
300+
}
301+
286302
#[test]
287303
fn multiple_crates_auto_binaries() {
288304
let p = project()

0 commit comments

Comments
 (0)