Ensure we don't overwrite an existing Cargo.lock when fetching an external git repo
This commit is contained in:
parent
f06831441b
commit
62bf33a9c6
1 changed files with 1 additions and 0 deletions
|
@ -143,6 +143,7 @@ impl GitRepo {
|
||||||
RelPath::PATCHES.to_path(dirs).join(format!("{}-lock.toml", self.patch_name));
|
RelPath::PATCHES.to_path(dirs).join(format!("{}-lock.toml", self.patch_name));
|
||||||
let target_lockfile = download_dir.join("Cargo.lock");
|
let target_lockfile = download_dir.join("Cargo.lock");
|
||||||
if source_lockfile.exists() {
|
if source_lockfile.exists() {
|
||||||
|
assert!(!target_lockfile.exists());
|
||||||
fs::copy(source_lockfile, target_lockfile).unwrap();
|
fs::copy(source_lockfile, target_lockfile).unwrap();
|
||||||
} else {
|
} else {
|
||||||
assert!(target_lockfile.exists());
|
assert!(target_lockfile.exists());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue