From 370f242fa20bbaaa70250cbc2574f60abe7f3ca9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 13 Feb 2017 09:24:29 +0000 Subject: [PATCH] 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. --- local/local.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local/local.go b/local/local.go index 357d43948..5a3f31c39 100644 --- a/local/local.go +++ b/local/local.go @@ -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}) } }