mirror of
https://github.com/restic/restic.git
synced 2024-12-24 08:44:52 +00:00
Merge pull request #1316 from restic/prune-wrong-data
prune: Warn about wrong plaintext blob ID
This commit is contained in:
commit
b47d991f56
1 changed files with 5 additions and 1 deletions
|
@ -3,7 +3,9 @@ package repository
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/debug"
|
"github.com/restic/restic/internal/debug"
|
||||||
"github.com/restic/restic/internal/fs"
|
"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)
|
id := restic.Hash(buf)
|
||||||
if !id.Equal(entry.ID) {
|
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)
|
h, tempfile.Name(), id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue