mirror of
https://github.com/rclone/rclone.git
synced 2024-11-08 01:25:14 +01:00
gcs: ignore zero length directory markers
This commit is contained in:
parent
a46f2a9eb7
commit
f6020f1308
@ -437,6 +437,17 @@ func (f *Fs) list(dir string, recurse bool, fn listFn) error {
|
||||
continue
|
||||
}
|
||||
remote := object.Name[rootLength:]
|
||||
// is this a directory marker?
|
||||
if strings.HasSuffix(remote, "/") && object.Size == 0 {
|
||||
if recurse {
|
||||
// add a directory in if --fast-list since will have no prefixes
|
||||
err = fn(remote[:len(remote)-1], object, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
continue // skip directory marker
|
||||
}
|
||||
err = fn(remote, object, false)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user