mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
local: Fix interaction between -x flag and --max-depth - fixes #1126
This was causing the by directory sync to ignore the -x flag because it was putting directories into the listing which should have been excluded.
This commit is contained in:
parent
7047c67a5e
commit
370f242fa2
@ -222,7 +222,7 @@ func (f *Fs) list(out fs.ListOpts, remote string, dirpath string, level int) (su
|
||||
if fi.IsDir() {
|
||||
// Ignore directories which are symlinks. These are junction points under windows which
|
||||
// are kind of a souped up symlink. Unix doesn't have directories which are symlinks.
|
||||
if (mode&os.ModeSymlink) == 0 && out.IncludeDirectory(newRemote) {
|
||||
if (mode&os.ModeSymlink) == 0 && out.IncludeDirectory(newRemote) && f.dev == readDevice(fi) {
|
||||
dir := &fs.Dir{
|
||||
Name: f.cleanRemote(newRemote),
|
||||
When: fi.ModTime(),
|
||||
@ -232,7 +232,7 @@ func (f *Fs) list(out fs.ListOpts, remote string, dirpath string, level int) (su
|
||||
if out.AddDir(dir) {
|
||||
return nil
|
||||
}
|
||||
if level > 0 && f.dev == readDevice(fi) {
|
||||
if level > 0 {
|
||||
subdirs = append(subdirs, listArgs{remote: newRemote, dirpath: newPath, level: level - 1})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user