@@ -553,7 +553,9 @@ struct commit_list *filter_skipped(struct commit_list *list,
553
553
return filtered ;
554
554
}
555
555
556
- static void bisect_rev_setup (struct rev_info * revs , const char * prefix )
556
+ static void bisect_rev_setup (struct rev_info * revs , const char * prefix ,
557
+ const char * bad_format , const char * good_format ,
558
+ int read_paths )
557
559
{
558
560
struct argv_array rev_argv = { NULL , 0 , 0 };
559
561
int i ;
@@ -564,26 +566,24 @@ static void bisect_rev_setup(struct rev_info *revs, const char *prefix)
564
566
565
567
/* rev_argv.argv[0] will be ignored by setup_revisions */
566
568
argv_array_push (& rev_argv , xstrdup ("bisect_rev_setup" ));
567
- argv_array_push_sha1 (& rev_argv , current_bad_sha1 , "%s" );
569
+ argv_array_push_sha1 (& rev_argv , current_bad_sha1 , bad_format );
568
570
for (i = 0 ; i < good_revs .sha1_nr ; i ++ )
569
- argv_array_push_sha1 (& rev_argv , good_revs .sha1 [i ], "^%s" );
571
+ argv_array_push_sha1 (& rev_argv , good_revs .sha1 [i ],
572
+ good_format );
570
573
argv_array_push (& rev_argv , xstrdup ("--" ));
571
- read_bisect_paths (& rev_argv );
574
+ if (read_paths )
575
+ read_bisect_paths (& rev_argv );
572
576
argv_array_push (& rev_argv , NULL );
573
577
574
578
setup_revisions (rev_argv .argv_nr , rev_argv .argv , revs , NULL );
575
- revs -> limited = 1 ;
576
579
}
577
580
578
- static void bisect_common (struct rev_info * revs , int * reaches , int * all )
581
+ static void bisect_common (struct rev_info * revs )
579
582
{
580
583
if (prepare_revision_walk (revs ))
581
584
die ("revision walk setup failed" );
582
585
if (revs -> tree_objects )
583
586
mark_edges_uninteresting (revs -> commits , revs , NULL );
584
-
585
- revs -> commits = find_bisection (revs -> commits , reaches , all ,
586
- !!skipped_revs .sha1_nr );
587
587
}
588
588
589
589
static void exit_if_skipped_commits (struct commit_list * tried ,
@@ -843,10 +843,13 @@ int bisect_next_all(const char *prefix)
843
843
844
844
check_good_are_ancestors_of_bad (prefix );
845
845
846
- bisect_rev_setup (& revs , prefix );
846
+ bisect_rev_setup (& revs , prefix , "%s" , "^%s" , 1 );
847
+ revs .limited = 1 ;
847
848
848
- bisect_common (& revs , & reaches , & all );
849
+ bisect_common (& revs );
849
850
851
+ revs .commits = find_bisection (revs .commits , & reaches , & all ,
852
+ !!skipped_revs .sha1_nr );
850
853
revs .commits = filter_skipped (revs .commits , & tried , 0 );
851
854
852
855
if (!revs .commits ) {
0 commit comments