Skip to content

Commit 6134403

Browse files
committed
fix: only display the "Vendored" status message when crates are actually vendored.
1 parent d35e959 commit 6134403

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/cargo/ops/vendor.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ pub fn vendor(ws: &Workspace<'_>, opts: &VendorOptions<'_>) -> CargoResult<()> {
5555
}
5656
}
5757

58-
gctx.shell().status(
59-
"Vendored",
60-
format!("{} crates into {}", count, opts.destination.display()),
61-
)?;
58+
if count > 0 {
59+
gctx.shell().status(
60+
"Vendored",
61+
format!("{} crates into {}", count, opts.destination.display()),
62+
)?;
63+
}
6264

6365
Ok(())
6466
}

tests/testsuite/build_scripts_multiple.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ fn verify_vendor_multiple_build_scripts() {
357357
[WARNING] ignoring `package.build` entry `build2.rs` as it is not included in the published package
358358
To use vendored sources, add this to your .cargo/config.toml for this project:
359359
360+
Vendored 1 crates into vendor
360361
361362
"#]])
362363
.run();

tests/testsuite/vendor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,7 @@ fn dont_delete_non_registry_sources_with_respect_source_config() {
19891989
Vendoring log v0.3.5 ([ROOT]/foo/vendor/log) to new-vendor-dir/log
19901990
To use vendored sources, add this to your .cargo/config.toml for this project:
19911991
1992+
Vendored 1 crates into new-vendor-dir
19921993
19931994
"#]])
19941995
.with_stdout_data(str![[r#"
@@ -2166,6 +2167,7 @@ fn vendor_local_registry() {
21662167
Vendoring bar v0.0.0 ([ROOT]/home/.cargo/registry/src/-[HASH]/bar-0.0.0) to vendor/bar
21672168
To use vendored sources, add this to your .cargo/config.toml for this project:
21682169
2170+
Vendored 1 crates into vendor
21692171
21702172
"#]])
21712173
.run();

0 commit comments

Comments
 (0)