Skip to content

Commit

Permalink
Merge branch 'daimond113/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 9, 2024
2 parents 7dff447 + fd87ac0 commit 8077f3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gix-worktree-state/src/checkout/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ fn open_options(path: &Path, destination_is_initially_empty: bool, overwrite_exi
options
.create_new(destination_is_initially_empty && !overwrite_existing)
.create(!destination_is_initially_empty || overwrite_existing)
.write(true);
.write(true)
.truncate(true);
options
}

Expand Down
2 changes: 1 addition & 1 deletion gix-worktree-state/tests/state/checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ fn overwriting_files_and_lone_directories_works() -> crate::Result {
|d| {
let empty = d.join("empty");
symlink::symlink_dir(d.join(".."), &empty)?; // empty is symlink to the directory above
std::fs::write(d.join("executable"), b"foo")?; // executable is regular file and has different content
std::fs::write(d.join("executable"), b"longer content foo bar")?; // executable is regular file and has different content
let dir = d.join("dir");
std::fs::create_dir(&dir)?;
std::fs::create_dir(dir.join("content"))?; // 'content' is a directory now
Expand Down

0 comments on commit 8077f3e

Please sign in to comment.