Skip to content

Commit 2ace972

Browse files
chriscoolgitster
authored andcommitted
bisect: move common bisect functionality to "bisect_common"
So we can easily reuse the code in a later patch. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 280e65c commit 2ace972

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

bisect.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,20 @@ static void bisect_rev_setup(struct rev_info *revs, const char *prefix)
532532
revs->limited = 1;
533533
}
534534

535+
static void bisect_common(struct rev_info *revs, const char *prefix,
536+
int *reaches, int *all)
537+
{
538+
bisect_rev_setup(revs, prefix);
539+
540+
if (prepare_revision_walk(revs))
541+
die("revision walk setup failed");
542+
if (revs->tree_objects)
543+
mark_edges_uninteresting(revs->commits, revs, NULL);
544+
545+
revs->commits = find_bisection(revs->commits, reaches, all,
546+
!!skipped_sha1_nr);
547+
}
548+
535549
int bisect_next_vars(const char *prefix)
536550
{
537551
struct rev_info revs;
@@ -542,15 +556,7 @@ int bisect_next_vars(const char *prefix)
542556
info.revs = &revs;
543557
info.bisect_show_flags = BISECT_SHOW_TRIED | BISECT_SHOW_STRINGED;
544558

545-
bisect_rev_setup(&revs, prefix);
546-
547-
if (prepare_revision_walk(&revs))
548-
die("revision walk setup failed");
549-
if (revs.tree_objects)
550-
mark_edges_uninteresting(revs.commits, &revs, NULL);
551-
552-
revs.commits = find_bisection(revs.commits, &reaches, &all,
553-
!!skipped_sha1_nr);
559+
bisect_common(&revs, prefix, &reaches, &all);
554560

555561
return show_bisect_vars(&info, reaches, all);
556562
}

0 commit comments

Comments
 (0)