mirror of
https://github.com/octoleo/restic.git
synced 2024-12-24 11:55:28 +00:00
cat: Add warning when pack was modified
This commit is contained in:
parent
26351522c5
commit
6c6b0e2395
@ -157,6 +157,11 @@ func (cmd CmdCat) Execute(args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hash := backend.Hash(buf)
|
||||||
|
if !hash.Equal(id) {
|
||||||
|
fmt.Fprintf(cmd.global.stderr, "Warning: hash of data does not match ID, want\n %v\ngot:\n %v\n", id.String(), hash.String())
|
||||||
|
}
|
||||||
|
|
||||||
_, err = os.Stdout.Write(buf)
|
_, err = os.Stdout.Write(buf)
|
||||||
return err
|
return err
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user