mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
fs: Clone(): open the destination with O_TRUNC
This commit is contained in:
parent
e42ad4987a
commit
ed13a20eef
1 changed files with 1 additions and 1 deletions
|
@ -145,7 +145,7 @@ func Clone(srcName, destName string) (cloned bool, err error) {
|
|||
_ = src.Close()
|
||||
}()
|
||||
|
||||
dest, err := OpenFile(destName, O_CREATE|O_WRONLY|O_NOFOLLOW, 0600)
|
||||
dest, err := OpenFile(destName, O_CREATE|O_TRUNC|O_WRONLY|O_NOFOLLOW, 0600)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue