@@ -564,41 +564,6 @@ fn apply_to_commit2(
564
564
) )
565
565
. transpose ( ) ;
566
566
}
567
- Op :: Compose ( filters) => {
568
- let filtered = filters
569
- . iter ( )
570
- . map ( |f| apply_to_commit2 ( & to_op ( * f) , commit, transaction) )
571
- . collect :: < Vec < _ > > ( )
572
- . into_iter ( )
573
- . collect :: < JoshResult < Option < Vec < _ > > > > ( ) ?;
574
-
575
- let filtered = some_or ! ( filtered, { return Ok ( None ) } ) ;
576
-
577
- let inverted = invert ( filter) ?;
578
-
579
- if filter == inverted {
580
- // If the filter is symetric it does not change any paths and uniqueness of
581
- // mappings is already guaranteed.
582
- let filtered = filtered
583
- . into_iter ( )
584
- . filter ( |id| * id != git2:: Oid :: zero ( ) )
585
- . into_iter ( )
586
- . map ( |id| Ok ( repo. find_commit ( id) ?. tree_id ( ) ) )
587
- . collect :: < JoshResult < Vec < _ > > > ( ) ?;
588
-
589
- tree:: compose_fast ( transaction, filtered) ?
590
- } else {
591
- let filtered = filters
592
- . iter ( )
593
- . zip ( filtered. into_iter ( ) )
594
- . filter ( |( _, id) | * id != git2:: Oid :: zero ( ) )
595
- . into_iter ( )
596
- . map ( |( f, id) | Ok ( ( f, repo. find_commit ( id) ?. tree ( ) ?) ) )
597
- . collect :: < JoshResult < Vec < _ > > > ( ) ?;
598
-
599
- tree:: compose ( transaction, filtered) ?
600
- }
601
- }
602
567
Op :: Workspace ( ws_path) => {
603
568
let normal_parents = commit
604
569
. parent_ids ( )
@@ -673,45 +638,6 @@ fn apply_to_commit2(
673
638
674
639
repo. find_tree ( filtered_tree) ?
675
640
}
676
- Op :: Subtract ( a, b) => {
677
- let af = {
678
- transaction
679
- . repo ( )
680
- . find_commit ( some_or ! (
681
- apply_to_commit2( & to_op( * a) , commit, transaction) ?,
682
- { return Ok ( None ) }
683
- ) )
684
- . map ( |x| x. tree_id ( ) )
685
- . unwrap_or_else ( |_| tree:: empty_id ( ) )
686
- } ;
687
- let bf = {
688
- transaction
689
- . repo ( )
690
- . find_commit ( some_or ! (
691
- apply_to_commit2( & to_op( * b) , commit, transaction) ?,
692
- { return Ok ( None ) }
693
- ) )
694
- . map ( |x| x. tree_id ( ) )
695
- . unwrap_or_else ( |_| tree:: empty_id ( ) )
696
- } ;
697
- let bf = repo. find_tree ( bf) ?;
698
- let bu = apply ( transaction, invert ( * b) ?, bf) ?;
699
- let ba = apply ( transaction, * a, bu) ?. id ( ) ;
700
- repo. find_tree ( tree:: subtract ( transaction, af, ba) ?) ?
701
- }
702
- Op :: Exclude ( b) => {
703
- let bf = {
704
- transaction
705
- . repo ( )
706
- . find_commit ( some_or ! (
707
- apply_to_commit2( & to_op( * b) , commit, transaction) ?,
708
- { return Ok ( None ) }
709
- ) )
710
- . map ( |x| x. tree_id ( ) )
711
- . unwrap_or_else ( |_| tree:: empty_id ( ) )
712
- } ;
713
- repo. find_tree ( tree:: subtract ( transaction, commit. tree_id ( ) , bf) ?) ?
714
- }
715
641
_ => apply ( transaction, filter, commit. tree ( ) ?) ?,
716
642
} ;
717
643
0 commit comments