mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:14:42 +01:00
sync: state whether duplicates are objects are directories
This commit is contained in:
parent
9ac72ee53f
commit
72add5ab27
@ -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 root
|
||||
|
@ -866,7 +866,7 @@ func matchListings(srcList, dstList DirEntries) (srcOnly DirEntries, dstOnly Dir
|
||||
if 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 Dir
|
||||
if 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")
|
||||
|
Loading…
Reference in New Issue
Block a user