local: fix detection of directories in new object creation

This stops the local listing erroring on all symlinks
This commit is contained in:
Nick Craig-Wood 2017-02-27 17:02:31 +00:00
parent f7252645ba
commit 5fba913207

View file

@ -162,7 +162,7 @@ func (f *Fs) newObjectWithInfo(remote string, info os.FileInfo) (fs.Object, erro
return nil, err
}
}
if !o.info.Mode().IsRegular() {
if o.info.Mode().IsDir() {
return nil, errors.Wrapf(fs.ErrorNotAFile, "%q", remote)
}
return o, nil