make Lookup() return all blobs

+ simplify syntax
This commit is contained in:
Alexander Weiss
2020-06-14 13:26:10 +02:00
committed by Michael Eischer
parent 020cab8e08
commit 9d1fb94c6c
13 changed files with 134 additions and 72 deletions

View File

@@ -146,8 +146,8 @@ func (r *Repository) LoadBlob(ctx context.Context, t restic.BlobType, id restic.
debug.Log("load %v with id %v (buf len %v, cap %d)", t, id, len(buf), cap(buf))
// lookup packs
blobs, found := r.idx.Lookup(id, t)
if !found {
blobs := r.idx.Lookup(id, t)
if len(blobs) == 0 {
debug.Log("id %v not found in index", id)
return nil, errors.Errorf("id %v not found in repository", id)
}