@@ -994,7 +994,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
994994 if (!strcmp (arg , "--all" ) || !strcmp (arg , "--branches" ) ||
995995 !strcmp (arg , "--tags" ) || !strcmp (arg , "--remotes" ) ||
996996 !strcmp (arg , "--reflog" ) || !strcmp (arg , "--not" ) ||
997- !strcmp (arg , "--no-walk" ) || !strcmp (arg , "--do-walk" ))
997+ !strcmp (arg , "--no-walk" ) || !strcmp (arg , "--do-walk" ) ||
998+ !strcmp (arg , "--bisect" ))
998999 {
9991000 unkv [(* unkc )++ ] = arg ;
10001001 return 1 ;
@@ -1218,6 +1219,16 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
12181219 ctx -> argc -= n ;
12191220}
12201221
1222+ static int for_each_bad_bisect_ref (each_ref_fn fn , void * cb_data )
1223+ {
1224+ return for_each_ref_in ("refs/bisect/bad" , fn , cb_data );
1225+ }
1226+
1227+ static int for_each_good_bisect_ref (each_ref_fn fn , void * cb_data )
1228+ {
1229+ return for_each_ref_in ("refs/bisect/good" , fn , cb_data );
1230+ }
1231+
12211232/*
12221233 * Parse revision information, filling in the "rev_info" structure,
12231234 * and removing the used arguments from the argument list.
@@ -1259,6 +1270,12 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
12591270 handle_refs (revs , flags , for_each_branch_ref );
12601271 continue ;
12611272 }
1273+ if (!strcmp (arg , "--bisect" )) {
1274+ handle_refs (revs , flags , for_each_bad_bisect_ref );
1275+ handle_refs (revs , flags ^ UNINTERESTING , for_each_good_bisect_ref );
1276+ revs -> bisect = 1 ;
1277+ continue ;
1278+ }
12621279 if (!strcmp (arg , "--tags" )) {
12631280 handle_refs (revs , flags , for_each_tag_ref );
12641281 continue ;
0 commit comments