aboutsummaryrefslogtreecommitdiff
path: root/pack_pack.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-01-17 23:00:14 +0800
committerGravatar Runxi Yu2026-01-17 23:00:14 +0800
commit90b5f779080272d5c6ef39e0c93d8592840a53b7 (patch)
treea954e45ec18d8a8dac49c8a3a60eae19a4c4f65e /pack_pack.go
parenthash: Key by algorithm, not size (diff)
signatureNo signature
repo: Drop hashSize and use hashAlgo.size()
Diffstat (limited to 'pack_pack.go')
-rw-r--r--pack_pack.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pack_pack.go b/pack_pack.go
index 6b8b356d..d91abf84 100644
--- a/pack_pack.go
+++ b/pack_pack.go
@@ -176,7 +176,7 @@ func (repo *Repository) packTypeSizeWithin(pf *packFile, ofs uint64, seen map[pa
case ObjectTypeCommit, ObjectTypeTree, ObjectTypeBlob, ObjectTypeTag:
return ty, declaredSize, nil
case ObjectTypeRefDelta:
- hashEnd := dataStart + uint64(repo.hashSize)
+ hashEnd := dataStart + uint64(repo.hashAlgo.size())
if hashEnd > uint64(len(pf.data)) {
return ObjectTypeInvalid, 0, io.ErrUnexpectedEOF
}
@@ -273,7 +273,7 @@ func (repo *Repository) packBodyResolveWithin(pf *packFile, ofs uint64) (ObjectT
resultTy = ty
resolved = true
case ObjectTypeRefDelta:
- hashEnd := dataStart + uint64(repo.hashSize)
+ hashEnd := dataStart + uint64(repo.hashAlgo.size())
if hashEnd > uint64(len(pf.data)) {
return fail(io.ErrUnexpectedEOF)
}