aboutsummaryrefslogtreecommitdiff
path: root/pack_pack.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-15 00:00:00 +0000
committerGravatar Runxi Yu2025-11-15 00:00:00 +0000
commit6f8acbf1503d2fa1ef705d35a743fc6b279942e5 (patch)
treed362c3e240e0a6ada3222df5fe9c4210d664b199 /pack_pack.go
parentUse verbose go test (diff)
signature
Add initial support for multi pack indexes
Diffstat (limited to 'pack_pack.go')
-rw-r--r--pack_pack.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pack_pack.go b/pack_pack.go
index 285431d8..eed3a4af 100644
--- a/pack_pack.go
+++ b/pack_pack.go
@@ -33,6 +33,19 @@ func (repo *Repository) packRead(id Hash) (Object, error) {
}
func (repo *Repository) packIndexFind(id Hash) (packlocation, error) {
+ midx, err := repo.multiPackIndex()
+ if err == nil {
+ loc, err := midx.lookup(id)
+ if err == nil {
+ return loc, nil
+ }
+ if !errors.Is(err, ErrNotFound) {
+ return packlocation{}, err
+ }
+ } else if !errors.Is(err, ErrNotFound) {
+ return packlocation{}, err
+ }
+
idxs, err := repo.packIndexes()
if err != nil {
return packlocation{}, err