Skip to content

Commit fba40a8

Browse files
committed
fix(command-vendor): fixed this issue
1 parent b751696 commit fba40a8

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/cargo/ops/vendor.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,16 @@ fn sync(
299299
// Can be removed once the minimal supported Windows version gets bumped.
300300
tracing::warn!("failed to `mv {unpacked_src:?} {dst:?}`: {e}");
301301
let paths: Vec<_> = walkdir(&unpacked_src).map(|e| e.into_path()).collect();
302-
cp_sources(pkg, src, &paths, &dst, &mut file_cksums, &mut tmp_buf, gctx)
303-
.with_context(|| format!("failed to copy vendored sources for {id}"))?;
302+
cp_sources(
303+
pkg,
304+
&unpacked_src,
305+
&paths,
306+
&dst,
307+
&mut file_cksums,
308+
&mut tmp_buf,
309+
gctx,
310+
)
311+
.with_context(|| format!("failed to copy vendored sources for {id}"))?;
304312
} else {
305313
compute_file_cksums(&dst)?;
306314
}

tests/testsuite/vendor.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,16 +2114,14 @@ fn vendor_rename_fallback() {
21142114

21152115
p.cargo("vendor --respect-source-config --no-delete")
21162116
.env("CARGO_LOG", "cargo::ops::vendor=warn")
2117-
.with_status(101)
2117+
.with_status(0)
21182118
.with_stderr_data(str![[r#"
21192119
...
21202120
[..]failed to `mv "[..]vendor[..].vendor-staging[..]log-0.3.5" "[..]vendor[..]log"`: [..]
21212121
...
2122-
[..]StripPrefixError[..]
2123-
...
21242122
"#]])
21252123
.run();
21262124

21272125
// Assert cp_sources fallback didn't work
2128-
assert!(!p.root().join("vendor/log/Cargo.toml").exists());
2126+
assert!(p.root().join("vendor/log/Cargo.toml").exists());
21292127
}

0 commit comments

Comments
 (0)