"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
sync: state whether duplicates are objects are directories
Nick Craig-Wood72add5ab27b3
diff --git a/fs/operations.go b/fs/operations.goindex ebbfe1ed6..045728525 100644--- a/fs/operations.go+++ b/fs/operations.go@@ -590,6 +590,18 @@ func (ds DirEntries) ForDirError(fn func(dir Directory) error) error {return nil}+// DirEntryType returns a string description of the DirEntry, either+// "object", "directory" or "unknown type XXX"+func DirEntryType(d DirEntry) string {+ switch d.(type) {+ case Object:+ return "object"+ case Directory:+ return "directory"+ }+ return fmt.Sprintf("unknown type %T", d)+}+// ListDirSorted reads Object and *Dir into entries for the given Fs.//// dir is the start directory, "" for rootdiff --git a/fs/sync.go b/fs/sync.goindex bbd6a442b..601d948f4 100644--- a/fs/sync.go+++ b/fs/sync.go@@ -866,7 +866,7 @@ func matchListings(srcList, dstList DirEntries) (srcOnly DirEntries, dstOnly Dirif src != nil && iSrc > 0 {prev := srcList[iSrc-1].Remote()if srcRemote == prev {- Logf(src, "Duplicate file found in source - ignoring")+ Logf(src, "Duplicate %s found in source - ignoring", DirEntryType(src))src = nil // ignore the src} else if srcRemote < prev {Errorf(src, "Out of order listing in source")@@ -876,7 +876,7 @@ func matchListings(srcList, dstList DirEntries) (srcOnly DirEntries, dstOnly Dirif dst != nil && iDst > 0 {prev := dstList[iDst-1].Remote()if dstRemote == prev {- Logf(dst, "Duplicate file found in destination - ignoring")+ Logf(dst, "Duplicate %s found in destination - ignoring", DirEntryType(dst))dst = nil // ignore the dst} else if dstRemote < prev {Errorf(dst, "Out of order listing in destination")