mirror of
https://github.com/restic/restic.git
synced 2025-08-11 10:07:47 +00:00
Change List() implementation for all backends
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user