mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-03 22:25:57 +00:00
Ported tests all pass
This commit is contained in:
parent
bbbc33d4dc
commit
edc1669ced
4 changed files with 32 additions and 17 deletions
|
|
@ -11,6 +11,7 @@ package rsync
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"hash"
|
||||
"io"
|
||||
|
|
@ -314,9 +315,9 @@ func (r *rsync) ApplyDelta(alignedTarget io.Writer, target io.ReadSeeker, op Ope
|
|||
return err
|
||||
}
|
||||
case OpHash:
|
||||
expected := r.checksummer.Sum(nil)
|
||||
if !bytes.Equal(expected, op.Data) {
|
||||
return fmt.Errorf("Failed to verify overall file checksum. This usually happens if some data was corrupted in transit or one of the involved files was altered while the transfer was in progress.")
|
||||
actual := r.checksummer.Sum(nil)
|
||||
if !bytes.Equal(actual, op.Data) {
|
||||
return fmt.Errorf("Failed to verify overall file checksum actual: %s != expected: %s. This usually happens if some data was corrupted in transit or one of the involved files was altered while the transfer was in progress.", hex.EncodeToString(actual), hex.EncodeToString(op.Data))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue