@@ -13,9 +13,6 @@ pub struct Config<'a> {
1313 pub dry_run : bool ,
1414 pub force_author : bool ,
1515 pub force_detach : bool ,
16- // force should only be used to enable oher force_* values when unifiying the config.
17- // Do not access when disabling individual safety checks.
18- pub force : bool ,
1916 pub base : Option < & ' a str > ,
2017 pub and_rebase : bool ,
2118 pub whole_file : bool ,
@@ -31,8 +28,6 @@ pub fn run(logger: &slog::Logger, config: &Config) -> Result<()> {
3128
3229fn run_with_repo ( logger : & slog:: Logger , config : & Config , repo : & git2:: Repository ) -> Result < ( ) > {
3330 let config = config:: unify ( & config, repo) ;
34- // have force flag enable all force* flags
35-
3631 let stack = stack:: working_stack (
3732 repo,
3833 config. base ,
@@ -566,28 +561,6 @@ mod tests {
566561 assert ! ( nothing_left_in_index( & ctx. repo) . unwrap( ) ) ;
567562 }
568563
569- #[ test]
570- fn foreign_author_with_force_flag ( ) {
571- let ctx = repo_utils:: prepare_and_stage ( ) ;
572-
573- repo_utils:: become_new_author ( & ctx. repo ) ;
574-
575- // run 'git-absorb'
576- let drain = slog:: Discard ;
577- let logger = slog:: Logger :: root ( drain, o ! ( ) ) ;
578- let config = Config {
579- force : true ,
580- ..DEFAULT_CONFIG
581- } ;
582- run_with_repo ( & logger, & config, & ctx. repo ) . unwrap ( ) ;
583-
584- let mut revwalk = ctx. repo . revwalk ( ) . unwrap ( ) ;
585- revwalk. push_head ( ) . unwrap ( ) ;
586- assert_eq ! ( revwalk. count( ) , 3 ) ;
587-
588- assert ! ( nothing_left_in_index( & ctx. repo) . unwrap( ) ) ;
589- }
590-
591564 #[ test]
592565 fn foreign_author_with_force_author_config ( ) {
593566 let ctx = repo_utils:: prepare_and_stage ( ) ;
@@ -630,15 +603,15 @@ mod tests {
630603 }
631604
632605 #[ test]
633- fn detached_head_pointing_at_branch_with_force_flag ( ) {
606+ fn detached_head_pointing_at_branch_with_force_detach_flag ( ) {
634607 let ctx = repo_utils:: prepare_and_stage ( ) ;
635608 repo_utils:: detach_head ( & ctx. repo ) ;
636609
637610 // run 'git-absorb'
638611 let drain = slog:: Discard ;
639612 let logger = slog:: Logger :: root ( drain, o ! ( ) ) ;
640613 let config = Config {
641- force : true ,
614+ force_detach : true ,
642615 ..DEFAULT_CONFIG
643616 } ;
644617 run_with_repo ( & logger, & config, & ctx. repo ) . unwrap ( ) ;
@@ -671,27 +644,6 @@ mod tests {
671644 assert ! ( nothing_left_in_index( & ctx. repo) . unwrap( ) ) ;
672645 }
673646
674- #[ test]
675- fn detached_head_with_force_flag ( ) {
676- let ctx = repo_utils:: prepare_and_stage ( ) ;
677- repo_utils:: detach_head ( & ctx. repo ) ;
678- repo_utils:: delete_branch ( & ctx. repo , "master" ) ;
679-
680- // run 'git-absorb'
681- let drain = slog:: Discard ;
682- let logger = slog:: Logger :: root ( drain, o ! ( ) ) ;
683- let config = Config {
684- force : true ,
685- ..DEFAULT_CONFIG
686- } ;
687- run_with_repo ( & logger, & config, & ctx. repo ) . unwrap ( ) ;
688- let mut revwalk = ctx. repo . revwalk ( ) . unwrap ( ) ;
689- revwalk. push_head ( ) . unwrap ( ) ;
690-
691- assert_eq ! ( revwalk. count( ) , 3 ) ;
692- assert ! ( nothing_left_in_index( & ctx. repo) . unwrap( ) ) ;
693- }
694-
695647 #[ test]
696648 fn detached_head_with_force_detach_config ( ) {
697649 let ctx = repo_utils:: prepare_and_stage ( ) ;
@@ -834,7 +786,6 @@ mod tests {
834786 dry_run : false ,
835787 force_author : false ,
836788 force_detach : false ,
837- force : false ,
838789 base : None ,
839790 and_rebase : false ,
840791 whole_file : false ,
0 commit comments