@@ -422,13 +422,17 @@ static void bisect_status(struct bisect_state *state,
422422{
423423 char * bad_ref = xstrfmt ("refs/bisect/%s" , terms -> term_bad );
424424 char * good_glob = xstrfmt ("%s-*" , terms -> term_good );
425+ struct refs_for_each_ref_options opts = {
426+ .pattern = good_glob ,
427+ .prefix = "refs/bisect/" ,
428+ .trim_prefix = strlen ("refs/bisect/" ),
429+ };
425430
426431 if (refs_ref_exists (get_main_ref_store (the_repository ), bad_ref ))
427432 state -> nr_bad = 1 ;
428433
429- refs_for_each_glob_ref_in (get_main_ref_store (the_repository ), inc_nr ,
430- good_glob , "refs/bisect/" ,
431- (void * ) & state -> nr_good );
434+ refs_for_each_ref_ext (get_main_ref_store (the_repository ),
435+ inc_nr , & state -> nr_good , & opts );
432436
433437 free (good_glob );
434438 free (bad_ref );
@@ -562,6 +566,10 @@ static int add_bisect_ref(const struct reference *ref, void *cb)
562566
563567static int prepare_revs (struct bisect_terms * terms , struct rev_info * revs )
564568{
569+ struct refs_for_each_ref_options opts = {
570+ .prefix = "refs/bisect/" ,
571+ .trim_prefix = strlen ("refs/bisect/" ),
572+ };
565573 int res = 0 ;
566574 struct add_bisect_ref_data cb = { revs };
567575 char * good = xstrfmt ("%s-*" , terms -> term_good );
@@ -581,11 +589,16 @@ static int prepare_revs(struct bisect_terms *terms, struct rev_info *revs)
581589 reset_revision_walk ();
582590 repo_init_revisions (the_repository , revs , NULL );
583591 setup_revisions (0 , NULL , revs , NULL );
584- refs_for_each_glob_ref_in (get_main_ref_store (the_repository ),
585- add_bisect_ref , bad , "refs/bisect/" , & cb );
592+
593+ opts .pattern = bad ;
594+ refs_for_each_ref_ext (get_main_ref_store (the_repository ),
595+ add_bisect_ref , & cb , & opts );
596+
586597 cb .object_flags = UNINTERESTING ;
587- refs_for_each_glob_ref_in (get_main_ref_store (the_repository ),
588- add_bisect_ref , good , "refs/bisect/" , & cb );
598+ opts .pattern = good ;
599+ refs_for_each_ref_ext (get_main_ref_store (the_repository ),
600+ add_bisect_ref , & cb , & opts );
601+
589602 if (prepare_revision_walk (revs ))
590603 res = error (_ ("revision walk setup failed" ));
591604
@@ -1191,10 +1204,14 @@ static int verify_good(const struct bisect_terms *terms, const char *command)
11911204 char * good_glob = xstrfmt ("%s-*" , terms -> term_good );
11921205 int no_checkout = refs_ref_exists (get_main_ref_store (the_repository ),
11931206 "BISECT_HEAD" );
1207+ struct refs_for_each_ref_options opts = {
1208+ .pattern = good_glob ,
1209+ .prefix = "refs/bisect/" ,
1210+ .trim_prefix = strlen ("refs/bisect/" ),
1211+ };
11941212
1195- refs_for_each_glob_ref_in (get_main_ref_store (the_repository ),
1196- get_first_good , good_glob , "refs/bisect/" ,
1197- & good_rev );
1213+ refs_for_each_ref_ext (get_main_ref_store (the_repository ),
1214+ get_first_good , & good_rev , & opts );
11981215 free (good_glob );
11991216
12001217 if (refs_read_ref (get_main_ref_store (the_repository ), no_checkout ? "BISECT_HEAD" : "HEAD" , & current_rev ))
0 commit comments