2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 12:55:18 +00:00

prune: Warn about wrong plaintext blob ID

This commit is contained in:
Alexander Neumann 2017-10-02 16:27:08 +02:00
parent 3afd974dea
commit f26492fc2d

View File

@ -3,7 +3,9 @@ package repository
import (
"context"
"crypto/sha256"
"fmt"
"io"
"os"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/fs"
@ -97,7 +99,9 @@ func Repack(ctx context.Context, repo restic.Repository, packs restic.IDSet, kee
id := restic.Hash(buf)
if !id.Equal(entry.ID) {
return nil, errors.Errorf("read blob %v from %v: wrong data returned, hash is %v",
debug.Log("read blob %v/%v from %v: wrong data returned, hash is %v",
h.Type, h.ID, tempfile.Name(), id)
fmt.Fprintf(os.Stderr, "read blob %v from %v: wrong data returned, hash is %v",
h, tempfile.Name(), id)
}