Skip to content

Commit 62bf33a

Browse files
committed
Ensure we don't overwrite an existing Cargo.lock when fetching an external git repo
1 parent f068314 commit 62bf33a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

build_system/prepare.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ impl GitRepo {
143143
RelPath::PATCHES.to_path(dirs).join(format!("{}-lock.toml", self.patch_name));
144144
let target_lockfile = download_dir.join("Cargo.lock");
145145
if source_lockfile.exists() {
146+
assert!(!target_lockfile.exists());
146147
fs::copy(source_lockfile, target_lockfile).unwrap();
147148
} else {
148149
assert!(target_lockfile.exists());

0 commit comments

Comments
 (0)