DownloadAndHash: Check error returned by Load()

This commit is contained in:
Alexander Neumann
2018-10-28 21:28:56 +01:00
parent 890eebf151
commit bfa18ee8ec
4 changed files with 128 additions and 15 deletions
+2 -3
View File
@@ -6,11 +6,10 @@ import (
"os"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/fs"
"github.com/restic/restic/internal/pack"
"github.com/restic/restic/internal/restic"
"github.com/restic/restic/internal/errors"
)
// Repack takes a list of packs together with a list of blobs contained in
@@ -24,7 +23,7 @@ func Repack(ctx context.Context, repo restic.Repository, packs restic.IDSet, kee
// load the complete pack into a temp file
h := restic.Handle{Type: restic.DataFile, Name: packID.String()}
tempfile, hash, packLength, err := DownloadAndHash(ctx, repo, h)
tempfile, hash, packLength, err := DownloadAndHash(ctx, repo.Backend(), h)
if err != nil {
return nil, errors.Wrap(err, "Repack")
}