forked from TrueCloudLab/rclone
sftp: don't check remote points to a file if it ends with /
This avoids calling stat on the root directory which saves a call and some servers don't like. See: https://forum.rclone.org/t/stat-failed-error-on-sftp/38045
This commit is contained in:
parent
e6e6069ecf
commit
2cd85813b4
1 changed files with 1 additions and 1 deletions
|
@ -1066,7 +1066,7 @@ func NewFsWithConnection(ctx context.Context, f *Fs, name string, root string, m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f.putSftpConnection(&c, err)
|
f.putSftpConnection(&c, err)
|
||||||
if root != "" {
|
if root != "" && !strings.HasSuffix(root, "/") {
|
||||||
// Check to see if the root is actually an existing file,
|
// Check to see if the root is actually an existing file,
|
||||||
// and if so change the filesystem root to its parent directory.
|
// and if so change the filesystem root to its parent directory.
|
||||||
oldAbsRoot := f.absRoot
|
oldAbsRoot := f.absRoot
|
||||||
|
|
Loading…
Add table
Reference in a new issue