Skip to content

Commit

Permalink
Fixed 2 bugs in restoring extended attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertchen committed Jan 29, 2018
1 parent 7230ddb commit 52fd553
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/duplicacy_backupmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,8 @@ func (manager *BackupManager) Restore(top string, revision int, inPlace bool, qu
totalFileSize, downloadedFileSize, startDownloadingTime) {
downloadedFileSize += file.Size
downloadedFiles = append(downloadedFiles, file)
file.RestoreMetadata(fullPath, nil, setOwner)
}

file.RestoreMetadata(fullPath, nil, setOwner)
}

if deleteMode && len(patterns) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion src/duplicacy_utils_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (entry *Entry) SetAttributesToFile(fullPath string) {
newAttribute, found := entry.Attributes[name]
if found {
oldAttribute, _ := xattr.Getxattr(fullPath, name)
if bytes.Equal(oldAttribute, newAttribute) {
if !bytes.Equal(oldAttribute, newAttribute) {
xattr.Setxattr(fullPath, name, newAttribute)
}
delete(entry.Attributes, name)
Expand Down

0 comments on commit 52fd553

Please sign in to comment.