aboutsummaryrefslogtreecommitdiff
path: root/pack_midx.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-17 00:00:00 +0000
committerGravatar Runxi Yu2025-11-17 00:00:00 +0000
commit1de28c5fc4331ed3841661246be167c450ff7986 (patch)
treeebe791cf909b8fb09d144457a83d50fbe5047ff8 /pack_midx.go
parentRemove 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_midx.go')
-rw-r--r--pack_midx.go18
1 files changed, 0 insertions, 18 deletions
diff --git a/pack_midx.go b/pack_midx.go
index 04151dfe..748bdaf6 100644
--- a/pack_midx.go
+++ b/pack_midx.go
@@ -1,7 +1,6 @@
package furgit
import (
- "bytes"
"fmt"
"os"
"path/filepath"
@@ -236,23 +235,6 @@ func (midx *multiPackIndex) parse(buf []byte) error {
midx.oids = oids
midx.offsets = offsets
midx.largeOffs = largeOffs
-
- if len(buf) < midx.repo.hashSize {
- return ErrInvalidObject
- }
- midxChecksumStart := len(buf) - midx.repo.hashSize
- midxChecksumInFile := buf[midxChecksumStart:]
-
- hashFn, ok := hashFuncs[midx.repo.hashSize]
- if !ok {
- return fmt.Errorf("furgit: unsupported hash size %d", midx.repo.hashSize)
- }
-
- computedHash := hashFn(buf[:midxChecksumStart])
- if !bytes.Equal(computedHash.data[:midx.repo.hashSize], midxChecksumInFile) {
- return fmt.Errorf("furgit: multi-pack-index checksum mismatch")
- }
-
return nil
}