Add symlink support (fixes #873)

This commit is contained in:
Audrius Butkevicius
2014-11-09 04:26:52 +00:00
committed by Jakob Borg
parent 6e88d9688b
commit c325ffd0f8
5 changed files with 179 additions and 28 deletions

View File

@@ -129,3 +129,18 @@ func Verify(r io.Reader, blocksize int, blocks []protocol.BlockInfo) error {
return nil
}
// BlockEqual returns whether two slices of blocks are exactly the same hash
// and index pair wise.
func BlocksEqual(src, tgt []protocol.BlockInfo) bool {
if len(tgt) != len(src) {
return false
}
for i, sblk := range src {
if !bytes.Equal(sblk.Hash, tgt[i].Hash) {
return false
}
}
return true
}