mirror of https://github.com/restic/restic.git
repository: remove redundant blob loading fallback from RepairPacks
LoadBlobsFromPack already implements the same fallback behavior.
This commit is contained in:
parent
e401af07b2
commit
433a6aad29
|
@ -30,14 +30,10 @@ func RepairPacks(ctx context.Context, repo restic.Repository, ids restic.IDSet,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := repo.LoadBlobsFromPack(wgCtx, b.PackID, blobs, func(blob restic.BlobHandle, buf []byte, err error) error {
|
err := repo.LoadBlobsFromPack(wgCtx, b.PackID, blobs, func(blob restic.BlobHandle, buf []byte, err error) error {
|
||||||
if err != nil {
|
|
||||||
// Fallback path
|
|
||||||
buf, err = repo.LoadBlob(wgCtx, blob.Type, blob.ID, nil)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
printer.E("failed to load blob %v: %v", blob.ID, err)
|
printer.E("failed to load blob %v: %v", blob.ID, err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
id, _, _, err := repo.SaveBlob(wgCtx, blob.Type, buf, restic.ID{}, true)
|
id, _, _, err := repo.SaveBlob(wgCtx, blob.Type, buf, restic.ID{}, true)
|
||||||
if !id.Equal(blob.ID) {
|
if !id.Equal(blob.ID) {
|
||||||
panic("pack id mismatch during upload")
|
panic("pack id mismatch during upload")
|
||||||
|
|
Loading…
Reference in New Issue