Skip to content

Commit 8077f3e

Browse files
committed
Merge branch 'daimond113/main'
2 parents 7dff447 + fd87ac0 commit 8077f3e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gix-worktree-state/src/checkout/entry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ fn open_options(path: &Path, destination_is_initially_empty: bool, overwrite_exi
245245
options
246246
.create_new(destination_is_initially_empty && !overwrite_existing)
247247
.create(!destination_is_initially_empty || overwrite_existing)
248-
.write(true);
248+
.write(true)
249+
.truncate(true);
249250
options
250251
}
251252

gix-worktree-state/tests/state/checkout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn overwriting_files_and_lone_directories_works() -> crate::Result {
199199
|d| {
200200
let empty = d.join("empty");
201201
symlink::symlink_dir(d.join(".."), &empty)?; // empty is symlink to the directory above
202-
std::fs::write(d.join("executable"), b"foo")?; // executable is regular file and has different content
202+
std::fs::write(d.join("executable"), b"longer content foo bar")?; // executable is regular file and has different content
203203
let dir = d.join("dir");
204204
std::fs::create_dir(&dir)?;
205205
std::fs::create_dir(dir.join("content"))?; // 'content' is a directory now

0 commit comments

Comments
 (0)