Change List() implementation for all backends
This commit is contained in:
parent
dd91b13ff3
commit
e9ea268847
12 changed files with 363 additions and 329 deletions
|
@ -143,7 +143,7 @@ func (be *MemoryBackend) Stat(ctx context.Context, h restic.Handle) (restic.File
|
|||
return restic.FileInfo{}, errNotFound
|
||||
}
|
||||
|
||||
return restic.FileInfo{Size: int64(len(e))}, nil
|
||||
return restic.FileInfo{Size: int64(len(e)), Name: h.Name}, nil
|
||||
}
|
||||
|
||||
// Remove deletes a file from the backend.
|
||||
|
@ -177,6 +177,10 @@ func (be *MemoryBackend) List(ctx context.Context, t restic.FileType, fn func(re
|
|||
Size: int64(len(buf)),
|
||||
}
|
||||
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
err := fn(fi)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue