mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:09:55 +08:00
azureblob: fix "Entry doesn't belong in directory" errors when using directory markers
Before this change we were incorrectly identifying the root directory of the listing and adding it into the listing. This caused higher layers of rclone to emit the error above. See #7038
This commit is contained in:
parent
3e2a606adb
commit
72b79504ea
|
@ -1063,11 +1063,7 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string,
|
||||||
fs.Debugf(f, "Odd name received %q", remote)
|
fs.Debugf(f, "Odd name received %q", remote)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
remote = remote[len(prefix):]
|
|
||||||
isDirectory := isDirectoryMarker(*file.Properties.ContentLength, file.Metadata, remote)
|
isDirectory := isDirectoryMarker(*file.Properties.ContentLength, file.Metadata, remote)
|
||||||
if addContainer {
|
|
||||||
remote = path.Join(containerName, remote)
|
|
||||||
}
|
|
||||||
if isDirectory {
|
if isDirectory {
|
||||||
// Don't insert the root directory
|
// Don't insert the root directory
|
||||||
if remote == directory {
|
if remote == directory {
|
||||||
|
@ -1076,6 +1072,10 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string,
|
||||||
// process directory markers as directories
|
// process directory markers as directories
|
||||||
remote = strings.TrimRight(remote, "/")
|
remote = strings.TrimRight(remote, "/")
|
||||||
}
|
}
|
||||||
|
remote = remote[len(prefix):]
|
||||||
|
if addContainer {
|
||||||
|
remote = path.Join(containerName, remote)
|
||||||
|
}
|
||||||
// Send object
|
// Send object
|
||||||
err = fn(remote, file, isDirectory)
|
err = fn(remote, file, isDirectory)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user