forked from TrueCloudLab/restic
Merge pull request #1365 from felix9/fix_1068
Fix failure to detect some legacy s3 repos
This commit is contained in:
commit
90b96d19cd
1 changed files with 2 additions and 1 deletions
|
@ -172,8 +172,9 @@ func (be *Backend) ReadDir(dir string) (list []os.FileInfo, err error) {
|
|||
}
|
||||
|
||||
name := strings.TrimPrefix(obj.Key, dir)
|
||||
// Sometimes s3 returns an entry for the dir itself. Ignore it.
|
||||
if name == "" {
|
||||
return nil, errors.Errorf("invalid key name %v, removing prefix %v yielded empty string", obj.Key, dir)
|
||||
continue
|
||||
}
|
||||
entry := fileInfo{
|
||||
name: name,
|
||||
|
|
Loading…
Reference in a new issue