diff options
| author | 2025-11-17 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-17 00:00:00 +0000 | |
| commit | 1de28c5fc4331ed3841661246be167c450ff7986 (patch) | |
| tree | ebe791cf909b8fb09d144457a83d50fbe5047ff8 /pack_idx.go | |
| parent | Remove an unnecessary blank line (diff) | |
| signature | ||
Revert "Compute checksum when reading packfiles"
This reverts commit 1dcb92427c23d0a8b23c0154b892243c749afa5a.
Yeah this should be part of the network protocol rather than being done
on *every read*.
Diffstat (limited to 'pack_idx.go')
| -rw-r--r-- | pack_idx.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/pack_idx.go b/pack_idx.go index a9cb9056..68170ad3 100644 --- a/pack_idx.go +++ b/pack_idx.go @@ -196,23 +196,6 @@ func (pi *packIndex) parse(buf []byte) error { pi.numObjects = nobj pi.names = buf[namesStart:namesEnd] pi.crcs = buf[crcStart:crcEnd] - - if len(buf) < 2*pi.repo.hashSize { - return ErrInvalidObject - } - idxChecksumStart := len(buf) - pi.repo.hashSize - idxChecksumInFile := buf[idxChecksumStart:] - - hashFn, ok := hashFuncs[pi.repo.hashSize] - if !ok { - return fmt.Errorf("furgit: unsupported hash size %d", pi.repo.hashSize) - } - - computedHash := hashFn(buf[:idxChecksumStart]) - if !bytes.Equal(computedHash.data[:pi.repo.hashSize], idxChecksumInFile) { - return fmt.Errorf("furgit: index checksum mismatch in %s", pi.idxRel) - } - return nil } |
