@@ -207,34 +207,36 @@ pub fn update(
207
207
rewrite_cache. clear_resource_cache_keep_allocation ( ) ;
208
208
diff_cache. clear_resource_cache_keep_allocation ( ) ;
209
209
from. changes ( ) ?
210
- . track_path ( )
211
- . track_rewrites ( Some ( rewrites) )
210
+ . options ( |opts| {
211
+ opts. track_path ( ) . track_rewrites ( Some ( rewrites) ) ;
212
+ } )
212
213
. for_each_to_obtain_tree_with_cache ( & to, & mut rewrite_cache, |change| {
213
- use gix:: object:: tree:: diff:: change :: Event :: * ;
214
+ use gix:: object:: tree:: diff:: Change :: * ;
214
215
change_counter. fetch_add ( 1 , Ordering :: SeqCst ) ;
215
- match change. event {
216
- Addition { entry_mode, id } => {
216
+ match change {
217
+ Addition {
218
+ entry_mode,
219
+ id,
220
+ location,
221
+ ..
222
+ } => {
217
223
if entry_mode. is_blob_or_symlink ( ) {
218
- add_lines ( & mut out, change . location , & lines_counter, id) ;
224
+ add_lines ( & mut out, location, & lines_counter, id) ;
219
225
}
220
226
}
221
227
Modification {
222
228
entry_mode,
223
229
previous_entry_mode,
224
230
id,
225
231
previous_id,
232
+ location,
226
233
} => match ( previous_entry_mode. is_blob ( ) , entry_mode. is_blob ( ) ) {
227
234
( false , false ) => { }
228
235
( false , true ) => {
229
- add_lines ( & mut out, change . location , & lines_counter, id) ;
236
+ add_lines ( & mut out, location, & lines_counter, id) ;
230
237
}
231
238
( true , false ) => {
232
- add_lines (
233
- & mut out,
234
- change. location ,
235
- & lines_counter,
236
- previous_id,
237
- ) ;
239
+ add_lines ( & mut out, location, & lines_counter, previous_id) ;
238
240
}
239
241
( true , true ) => {
240
242
if let Ok ( cache) =
@@ -266,7 +268,7 @@ pub fn update(
266
268
lines_counter
267
269
. fetch_add ( nl, Ordering :: SeqCst ) ;
268
270
out. push ( FileChange {
269
- relpath : change . location . to_owned ( ) ,
271
+ relpath : location. to_owned ( ) ,
270
272
mode : FileMode :: Modified ,
271
273
source_relpath : None ,
272
274
lines : Some ( lines) ,
@@ -281,19 +283,25 @@ pub fn update(
281
283
}
282
284
}
283
285
} ,
284
- Deletion { entry_mode, id } => {
286
+ Deletion {
287
+ entry_mode,
288
+ id,
289
+ location,
290
+ ..
291
+ } => {
285
292
if entry_mode. is_blob_or_symlink ( ) {
286
- remove_lines ( & mut out, change . location , & lines_counter, id) ;
293
+ remove_lines ( & mut out, location, & lines_counter, id) ;
287
294
}
288
295
}
289
296
Rewrite {
290
297
source_location,
291
298
diff,
292
299
copy,
300
+ location,
293
301
..
294
302
} => {
295
303
out. push ( FileChange {
296
- relpath : change . location . to_owned ( ) ,
304
+ relpath : location. to_owned ( ) ,
297
305
source_relpath : Some ( source_location. to_owned ( ) ) ,
298
306
mode : if copy { FileMode :: Copy } else { FileMode :: Rename } ,
299
307
lines : diff. map ( |d| LineStats {
@@ -369,7 +377,7 @@ pub fn update(
369
377
}
370
378
}
371
379
372
- impl < ' a , Find > gix:: prelude:: Find for Db < ' a , Find >
380
+ impl < Find > gix:: prelude:: Find for Db < ' _ , Find >
373
381
where
374
382
Find : gix:: prelude:: Find + Clone ,
375
383
{
0 commit comments