@@ -174,6 +174,7 @@ pub fn file(
174
174
commit_id : suspect,
175
175
blob_id : entry. unwrap_or ( ObjectId :: null ( gix_hash:: Kind :: Sha1 ) ) ,
176
176
previous_blob_id : ObjectId :: null ( gix_hash:: Kind :: Sha1 ) ,
177
+ index : 0 ,
177
178
} ;
178
179
blame_path. push ( blame_path_entry) ;
179
180
}
@@ -263,13 +264,13 @@ pub fn file(
263
264
}
264
265
265
266
let more_than_one_parent = parent_ids. len ( ) > 1 ;
266
- for ( parent_id, parent_commit_time) in parent_ids {
267
- queue. insert ( parent_commit_time, parent_id) ;
267
+ for ( index , ( parent_id, parent_commit_time) ) in parent_ids. iter ( ) . enumerate ( ) {
268
+ queue. insert ( * parent_commit_time, * parent_id) ;
268
269
let changes_for_file_path = tree_diff_at_file_path (
269
270
& odb,
270
271
current_file_path. as_ref ( ) ,
271
272
suspect,
272
- parent_id,
273
+ * parent_id,
273
274
cache. as_ref ( ) ,
274
275
& mut stats,
275
276
& mut diff_state,
@@ -284,10 +285,10 @@ pub fn file(
284
285
// None of the changes affected the file we’re currently blaming.
285
286
// Copy blame to parent.
286
287
for unblamed_hunk in & mut hunks_to_blame {
287
- unblamed_hunk. clone_blame ( suspect, parent_id) ;
288
+ unblamed_hunk. clone_blame ( suspect, * parent_id) ;
288
289
}
289
290
} else {
290
- pass_blame_from_to ( suspect, parent_id, & mut hunks_to_blame) ;
291
+ pass_blame_from_to ( suspect, * parent_id, & mut hunks_to_blame) ;
291
292
}
292
293
continue ;
293
294
} ;
@@ -306,6 +307,7 @@ pub fn file(
306
307
commit_id : suspect,
307
308
blob_id : id,
308
309
previous_blob_id : ObjectId :: null ( gix_hash:: Kind :: Sha1 ) ,
310
+ index,
309
311
} ;
310
312
blame_path. push ( blame_path_entry) ;
311
313
}
@@ -327,14 +329,15 @@ pub fn file(
327
329
options. diff_algorithm ,
328
330
& mut stats,
329
331
) ?;
330
- hunks_to_blame = process_changes ( hunks_to_blame, changes, suspect, parent_id) ;
332
+ hunks_to_blame = process_changes ( hunks_to_blame, changes, suspect, * parent_id) ;
331
333
if let Some ( ref mut blame_path) = blame_path {
332
334
let blame_path_entry = BlamePathEntry {
333
335
source_file_path : current_file_path. clone ( ) ,
334
336
previous_source_file_path : Some ( current_file_path. clone ( ) ) ,
335
337
commit_id : suspect,
336
338
blob_id : id,
337
339
previous_blob_id : previous_id,
340
+ index,
338
341
} ;
339
342
blame_path. push ( blame_path_entry) ;
340
343
}
@@ -354,7 +357,7 @@ pub fn file(
354
357
options. diff_algorithm ,
355
358
& mut stats,
356
359
) ?;
357
- hunks_to_blame = process_changes ( hunks_to_blame, changes, suspect, parent_id) ;
360
+ hunks_to_blame = process_changes ( hunks_to_blame, changes, suspect, * parent_id) ;
358
361
359
362
let mut has_blame_been_passed = false ;
360
363
@@ -374,6 +377,7 @@ pub fn file(
374
377
commit_id : suspect,
375
378
blob_id : id,
376
379
previous_blob_id : source_id,
380
+ index,
377
381
} ;
378
382
blame_path. push ( blame_path_entry) ;
379
383
}
0 commit comments