cat: Add warning when pack was modified
This commit is contained in:
parent
26351522c5
commit
6c6b0e2395
1 changed files with 5 additions and 0 deletions
|
@ -157,6 +157,11 @@ func (cmd CmdCat) Execute(args []string) error {
|
|||
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)
|
||||
return err
|
||||
|
||||
|
|
Loading…
Reference in a new issue