From f24da2291e8fc5dd6e80047cb45f06ec69a9059c Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 17 Nov 2025 00:00:00 +0000 Subject: Disable per-object validation during reads In general, git inflates the packed objects and recomputes the object hash before accepting them into hte object database during remote operations. But when simply inflating/parsing the objects for read from the local object store, it does not recompute the hash. --- loose.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'loose.go') diff --git a/loose.go b/loose.go index 84ebd006..735b7a96 100644 --- a/loose.go +++ b/loose.go @@ -70,9 +70,9 @@ func (repo *Repository) looseReadTyped(id Hash) (ObjectType, []byte, error) { if declaredSize != int64(len(body)) { return ObjectTypeInvalid, nil, ErrInvalidObject } - if !repo.verifyRawObject(raw, id) { - return ObjectTypeInvalid, nil, ErrInvalidObject - } + // if !repo.verifyRawObject(raw, id) { + // return ObjectTypeInvalid, nil, ErrInvalidObject + // } out := append([]byte(nil), body...) return ty, out, nil -- cgit v1.3.1-10-gc9f91