Skip to content

Commit

Permalink
Fixed a bug that caused a fresh restore to fail without the -overwrit…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
gilbertchen committed Nov 3, 2020
1 parent b392302 commit bec3a0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/duplicacy_backupmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ func (manager *BackupManager) RestoreFile(chunkDownloader *ChunkDownloader, chun
}

// fileHash != entry.Hash, warn/error depending on -overwrite option
if !overwrite {
if !overwrite && !isNewFile {
LOG_WERROR(allowFailures, "DOWNLOAD_OVERWRITE",
"File %s already exists. Please specify the -overwrite option to overwrite", entry.Path)
return false, fmt.Errorf("file exists")
Expand Down

2 comments on commit bec3a0e

@gilbertchen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gilbertchen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Duplicacy Forum. There might be relevant details there:

https://forum.duplicacy.com/t/cli-2-7-2-is-now-available/4483/1

Please sign in to comment.