"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
gcs: fix "Entry doesn't belong in directory" errors when using directory markers
Nick Craig-Wood3e2a606adb0d
diff --git a/backend/googlecloudstorage/googlecloudstorage.go b/backend/googlecloudstorage/googlecloudstorage.goindex c8537372d..4bd7a41e4 100644--- a/backend/googlecloudstorage/googlecloudstorage.go+++ b/backend/googlecloudstorage/googlecloudstorage.go@@ -690,11 +690,7 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuckfs.Logf(f, "Odd name received %q", object.Name)continue}- remote = remote[len(prefix):]isDirectory := remote == "" || strings.HasSuffix(remote, "/")- if addBucket {- remote = path.Join(bucket, remote)- }// is this a directory marker?if isDirectory {// Don't insert the root directory@@ -704,6 +700,10 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck// process directory markers as directoriesremote = strings.TrimRight(remote, "/")}+ remote = remote[len(prefix):]+ if addBucket {+ remote = path.Join(bucket, remote)+ }err = fn(remote, object, isDirectory)if err != nil {