@@ -452,12 +452,12 @@ fn tree_diff_at_file_path(
452
452
lhs_tree_buf : & mut Vec < u8 > ,
453
453
rhs_tree_buf : & mut Vec < u8 > ,
454
454
) -> Result < Option < gix_diff:: tree:: recorder:: Change > , Error > {
455
- let parent_tree_id = tree_id ( find_commit ( cache, & odb, & parent_id, commit_buf) ?) ?;
455
+ let parent_tree_id = find_commit ( cache, & odb, & parent_id, commit_buf) ?. tree_id ( ) ?;
456
456
457
457
let parent_tree_iter = odb. find_tree_iter ( & parent_tree_id, lhs_tree_buf) ?;
458
458
stats. trees_decoded += 1 ;
459
459
460
- let tree_id = tree_id ( find_commit ( cache, & odb, & id, commit_buf) ?) ?;
460
+ let tree_id = find_commit ( cache, & odb, & id, commit_buf) ?. tree_id ( ) ?;
461
461
462
462
let tree_iter = odb. find_tree_iter ( & tree_id, rhs_tree_buf) ?;
463
463
stats. trees_decoded += 1 ;
@@ -654,7 +654,7 @@ fn find_path_entry_in_commit(
654
654
buf2 : & mut Vec < u8 > ,
655
655
stats : & mut Statistics ,
656
656
) -> Result < Option < ObjectId > , Error > {
657
- let tree_id = tree_id ( find_commit ( cache, odb, commit, buf) ?) ?;
657
+ let tree_id = find_commit ( cache, odb, commit, buf) ?. tree_id ( ) ?;
658
658
let tree_iter = odb. find_tree_iter ( & tree_id, buf) ?;
659
659
stats. trees_decoded += 1 ;
660
660
@@ -710,13 +710,6 @@ fn collect_parents(
710
710
Ok ( parent_ids)
711
711
}
712
712
713
- fn tree_id ( commit : gix_traverse:: commit:: Either < ' _ , ' _ > ) -> Result < ObjectId , Error > {
714
- match commit {
715
- gix_traverse:: commit:: Either :: CommitRefIter ( mut commit_ref_iter) => Ok ( commit_ref_iter. tree_id ( ) ?) ,
716
- gix_traverse:: commit:: Either :: CachedCommit ( commit) => Ok ( commit. root_tree_id ( ) . into ( ) ) ,
717
- }
718
- }
719
-
720
713
/// Return an iterator over tokens for use in diffing. These are usually lines, but it's important
721
714
/// to unify them so the later access shows the right thing.
722
715
pub ( crate ) fn tokens_for_diffing ( data : & [ u8 ] ) -> impl TokenSource < Token = & [ u8 ] > {
0 commit comments