mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
path -> startPath in walkRDirTree (we need the path package)
This commit is contained in:
parent
a3a436ce16
commit
cef2e3bf83
10
fs/walk.go
10
fs/walk.go
@ -347,10 +347,10 @@ func (dt DirTree) String() string {
|
||||
return out.String()
|
||||
}
|
||||
|
||||
func walkRDirTree(f Fs, path string, includeAll bool, maxLevel int, listR ListRFn) (DirTree, error) {
|
||||
func walkRDirTree(f Fs, startPath string, includeAll bool, maxLevel int, listR ListRFn) (DirTree, error) {
|
||||
dirs := make(DirTree)
|
||||
var mu sync.Mutex
|
||||
err := listR(path, func(entries DirEntries) error {
|
||||
err := listR(startPath, func(entries DirEntries) error {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
for _, entry := range entries {
|
||||
@ -367,7 +367,7 @@ func walkRDirTree(f Fs, path string, includeAll bool, maxLevel int, listR ListRF
|
||||
for ; slashes > maxLevel-1; slashes-- {
|
||||
dirPath = parentDir(dirPath)
|
||||
}
|
||||
dirs.checkParent(path, dirPath)
|
||||
dirs.checkParent(startPath, dirPath)
|
||||
}
|
||||
} else {
|
||||
Debugf(x, "Excluded from sync (and deletion)")
|
||||
@ -394,9 +394,9 @@ func walkRDirTree(f Fs, path string, includeAll bool, maxLevel int, listR ListRF
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dirs.checkParents(path)
|
||||
dirs.checkParents(startPath)
|
||||
if len(dirs) == 0 {
|
||||
dirs[path] = nil
|
||||
dirs[startPath] = nil
|
||||
}
|
||||
dirs.Sort()
|
||||
return dirs, nil
|
||||
|
Loading…
Reference in New Issue
Block a user