aboutsummaryrefslogtreecommitdiff
path: root/pack_midx.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-16 00:00:00 +0000
committerGravatar Runxi Yu2025-11-16 00:00:00 +0000
commit3bde7664e748dd648f58c0a5280612c239dc0870 (patch)
treeb16d6427a70f4e49f4c0b47eead8d420612123fb /pack_midx.go
parentRemove repo.Root (diff)
signature
Unexport Repository.HashSize
Diffstat (limited to 'pack_midx.go')
-rw-r--r--pack_midx.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pack_midx.go b/pack_midx.go
index 0c4f3213..ec6cb924 100644
--- a/pack_midx.go
+++ b/pack_midx.go
@@ -198,7 +198,7 @@ func (midx *multiPackIndex) parse(buf []byte) error {
if !ok {
return ErrInvalidObject
}
- oidlSize := int64(numObjects) * int64(midx.repo.HashSize)
+ oidlSize := int64(numObjects) * int64(midx.repo.hashSize)
if oidlOffset < 0 || oidlOffset+oidlSize > int64(len(buf)) {
return ErrInvalidObject
}
@@ -247,8 +247,8 @@ func (midx *multiPackIndex) lookup(id Hash) (packlocation, error) {
}
// Verify hash size matches repository hash size
- if id.size != midx.repo.HashSize {
- return packlocation{}, fmt.Errorf("furgit: hash size mismatch: got %d, expected %d", id.size, midx.repo.HashSize)
+ if id.size != midx.repo.hashSize {
+ return packlocation{}, fmt.Errorf("furgit: hash size mismatch: got %d, expected %d", id.size, midx.repo.hashSize)
}
first := int(id.data[0])
@@ -258,7 +258,7 @@ func (midx *multiPackIndex) lookup(id Hash) (packlocation, error) {
}
hi := int(readBE32(midx.fanout[first*4 : (first+1)*4]))
- idx, found := bsearchHash(midx.oids, midx.repo.HashSize, lo, hi, id)
+ idx, found := bsearchHash(midx.oids, midx.repo.hashSize, lo, hi, id)
if !found {
return packlocation{}, ErrNotFound
}