From 62bf33a9c670a7cc9273d35fc52c8f0d5a0b115b Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 14 Oct 2023 12:41:44 +0000 Subject: [PATCH] Ensure we don't overwrite an existing Cargo.lock when fetching an external git repo --- build_system/prepare.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/build_system/prepare.rs b/build_system/prepare.rs index 16e7a4bafae..c68968b4fde 100644 --- a/build_system/prepare.rs +++ b/build_system/prepare.rs @@ -143,6 +143,7 @@ impl GitRepo { 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());