@@ -75,6 +75,7 @@ pub(crate) mod error {
75
75
}
76
76
}
77
77
pub use error:: Error ;
78
+ use gix_features:: zlib;
78
79
79
80
use crate :: { store:: types:: PackId , Find } ;
80
81
86
87
& ' b self ,
87
88
mut id : & ' b gix_hash:: oid ,
88
89
buffer : & ' a mut Vec < u8 > ,
90
+ inflate : & mut zlib:: Inflate ,
89
91
pack_cache : & mut impl DecodeEntry ,
90
92
snapshot : & mut load_index:: Snapshot ,
91
93
recursion : Option < error:: DeltaBaseRecursion < ' _ > > ,
@@ -147,6 +149,7 @@ where
147
149
let res = match pack. decode_entry (
148
150
entry,
149
151
buffer,
152
+ inflate,
150
153
|id, _out| {
151
154
index_file. pack_offset_by_id ( id) . map ( |pack_offset| {
152
155
gix_pack:: data:: decode:: entry:: ResolvedBase :: InPack ( pack. entry ( pack_offset) )
@@ -182,6 +185,7 @@ where
182
185
. try_find_cached_inner (
183
186
& base_id,
184
187
& mut buf,
188
+ inflate,
185
189
pack_cache,
186
190
snapshot,
187
191
recursion
@@ -231,6 +235,7 @@ where
231
235
pack. decode_entry (
232
236
entry,
233
237
buffer,
238
+ inflate,
234
239
|id, out| {
235
240
index_file
236
241
. pack_offset_by_id ( id)
@@ -347,7 +352,8 @@ where
347
352
) -> Result < Option < ( gix_object:: Data < ' a > , Option < gix_pack:: data:: entry:: Location > ) > , Self :: Error > {
348
353
let id = id. as_ref ( ) ;
349
354
let mut snapshot = self . snapshot . borrow_mut ( ) ;
350
- self . try_find_cached_inner ( id, buffer, pack_cache, & mut snapshot, None )
355
+ let mut inflate = self . inflate . borrow_mut ( ) ;
356
+ self . try_find_cached_inner ( id, buffer, & mut inflate, pack_cache, & mut snapshot, None )
351
357
}
352
358
353
359
fn location_by_oid (
@@ -364,6 +370,7 @@ where
364
370
365
371
let id = id. as_ref ( ) ;
366
372
let mut snapshot = self . snapshot . borrow_mut ( ) ;
373
+ let mut inflate = self . inflate . borrow_mut ( ) ;
367
374
' outer: loop {
368
375
{
369
376
let marker = snapshot. marker ;
@@ -404,13 +411,14 @@ where
404
411
buf. resize ( entry. decompressed_size . try_into ( ) . expect ( "representable size" ) , 0 ) ;
405
412
assert_eq ! ( pack. id, pack_id. to_intrinsic_pack_id( ) , "both ids must always match" ) ;
406
413
407
- let res = pack. decompress_entry ( & entry, buf) . ok ( ) . map ( |entry_size_past_header| {
408
- gix_pack:: data:: entry:: Location {
414
+ let res = pack
415
+ . decompress_entry ( & entry, & mut inflate, buf)
416
+ . ok ( )
417
+ . map ( |entry_size_past_header| gix_pack:: data:: entry:: Location {
409
418
pack_id : pack. id ,
410
419
pack_offset,
411
420
entry_size : entry. header_size ( ) + entry_size_past_header,
412
- }
413
- } ) ;
421
+ } ) ;
414
422
415
423
if idx != 0 {
416
424
snapshot. indices . swap ( 0 , idx) ;
0 commit comments