Skip to content

Commit

Permalink
skip check sum for symlink
Browse files Browse the repository at this point in the history
Signed-off-by: xixi <[email protected]>
  • Loading branch information
Hexilee committed Oct 7, 2023
1 parent 261aa5a commit e6eda47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,15 @@ func worker(tasks <-chan object.Object, src, dst object.ObjectStorage, config *C
break
}
var err error
var dataCopied bool
if config.Links && obj.IsSymlink() {
err = copyLink(src, dst, key)
} else {
dataCopied = true
err = copyData(src, dst, key, obj.Size())
}

if err == nil && (config.CheckAll || config.CheckNew) {
if err == nil && (config.CheckAll || config.CheckNew) && dataCopied {
var equal bool
if equal, err = checkSum(src, dst, key, obj.Size()); err == nil && !equal {
err = fmt.Errorf("checksums of copied object %s don't match", key)
Expand Down

0 comments on commit e6eda47

Please sign in to comment.