lsjson: make --stat more efficient
Don't look for a file if the remote ends with / This also makes it less likely to find a directory marker in bucket based file systems.
This commit is contained in:
parent
c4a9e480c9
commit
335ca6d572
1 changed files with 1 additions and 1 deletions
|
@ -291,7 +291,7 @@ func StatJSON(ctx context.Context, fsrc fs.Fs, remote string, opt *ListJSONOpt)
|
|||
}
|
||||
|
||||
// Could be a file or a directory here
|
||||
if lj.files {
|
||||
if lj.files && !strings.HasSuffix(remote, "/") {
|
||||
// NewObject can return the sentinel errors ErrorObjectNotFound or ErrorIsDir
|
||||
// ErrorObjectNotFound can mean the source is a directory or not found
|
||||
obj, err := fsrc.NewObject(ctx, remote)
|
||||
|
|
Loading…
Reference in a new issue