ls: Fix listing buckets with --versions (#3462)

mc ls --versions alias/ has an unexpected output due to missing
consideration of this use case. This commit fixes the behavior.
This commit is contained in:
Anis Elleuch
2020-10-22 17:35:51 -07:00
committed by GitHub
parent d1232dc089
commit fa4da03a4f
+9 -1
View File
@@ -1654,8 +1654,16 @@ func (c *S3Client) versionedList(ctx context.Context, contentCh chan *ClientCont
}
return
}
for _, bucket := range buckets {
// List only buckets if not recursive
if !opts.IsRecursive {
for _, bucket := range buckets {
contentCh <- c.bucketInfo2ClientContent(bucket)
}
return
}
for _, bucket := range buckets {
if opts.ShowDir == DirFirst {
contentCh <- c.bucketInfo2ClientContent(bucket)
}