@@ -564,41 +564,6 @@ fn apply_to_commit2(
564564 ) )
565565 . transpose ( ) ;
566566 }
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- }
602567 Op :: Workspace ( ws_path) => {
603568 let normal_parents = commit
604569 . parent_ids ( )
@@ -673,45 +638,6 @@ fn apply_to_commit2(
673638
674639 repo. find_tree ( filtered_tree) ?
675640 }
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- }
715641 _ => apply ( transaction, filter, commit. tree ( ) ?) ?,
716642 } ;
717643
0 commit comments