mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
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
|
@ -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…
Reference in New Issue
Block a user