mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-11 05:43:23 +00:00
Fixed a bug that caused a fresh restore to fail without the -overwrite option
When restoring a file that doesn't exit locally, if the file is large (>100M) Duplicacy will create an empty sparse file. But this newly created file will be mistaken for a local copy and hence the restore will fail with a message suggesting the -overwrite option.
This commit is contained in:
@@ -1377,7 +1377,7 @@ func (manager *BackupManager) RestoreFile(chunkDownloader *ChunkDownloader, chun
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fileHash != entry.Hash, warn/error depending on -overwrite option
|
// fileHash != entry.Hash, warn/error depending on -overwrite option
|
||||||
if !overwrite {
|
if !overwrite && !isNewFile {
|
||||||
LOG_WERROR(allowFailures, "DOWNLOAD_OVERWRITE",
|
LOG_WERROR(allowFailures, "DOWNLOAD_OVERWRITE",
|
||||||
"File %s already exists. Please specify the -overwrite option to overwrite", entry.Path)
|
"File %s already exists. Please specify the -overwrite option to overwrite", entry.Path)
|
||||||
return false, fmt.Errorf("file exists")
|
return false, fmt.Errorf("file exists")
|
||||||
|
|||||||
Reference in New Issue
Block a user