Skip to content

Commit aab78f1

Browse files
committed
Truncate file when checking out
1 parent 7dff447 commit aab78f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
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

0 commit comments

Comments
 (0)