Fixed #83: don't pass unchanged files to the chunk downloader

This commit is contained in:
Gilbert Chen
2017-07-04 14:50:34 -04:00
parent 4291bc775b
commit 12134ea6ad

View File

@@ -749,6 +749,7 @@ func (manager *BackupManager) Restore(top string, revision int, inPlace bool, qu
i := 0
for _, entry := range remoteSnapshot.Files {
skipped := false
// Find local files that don't exist in the remote snapshot
for i < len(localSnapshot.Files) {
local := localSnapshot.Files[i]
@@ -760,11 +761,18 @@ func (manager *BackupManager) Restore(top string, revision int, inPlace bool, qu
} else {
if compare == 0 {
i++
if quickMode && local.IsSameAs(entry) {
skipped = true
}
}
break
}
}
if skipped {
continue
}
fullPath := joinPath(top, entry.Path)
if entry.IsLink() {
stat, err := os.Lstat(fullPath)