Ensure we don't overwrite an existing Cargo.lock when fetching an external git repo
This commit is contained in:
parent
f06831441b
commit
62bf33a9c6
@ -143,6 +143,7 @@ pub(crate) fn fetch(&self, dirs: &Dirs) {
|
||||
RelPath::PATCHES.to_path(dirs).join(format!("{}-lock.toml", self.patch_name));
|
||||
let target_lockfile = download_dir.join("Cargo.lock");
|
||||
if source_lockfile.exists() {
|
||||
assert!(!target_lockfile.exists());
|
||||
fs::copy(source_lockfile, target_lockfile).unwrap();
|
||||
} else {
|
||||
assert!(target_lockfile.exists());
|
||||
|
Loading…
Reference in New Issue
Block a user