mirror of
https://github.com/octoleo/restic.git
synced 2025-02-07 06:18:25 +00:00
Merge pull request #1365 from felix9/fix_1068
Fix failure to detect some legacy s3 repos
This commit is contained in:
commit
90b96d19cd
@ -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…
x
Reference in New Issue
Block a user