Commit 2ace9727 authored by Christian Couder's avatar Christian Couder Committed by Junio C Hamano

bisect: move common bisect functionality to "bisect_common"

So we can easily reuse the code in a later patch.
Signed-off-by: Christian Couder's avatarChristian Couder <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 280e65cb
......@@ -532,6 +532,20 @@ static void bisect_rev_setup(struct rev_info *revs, const char *prefix)
revs->limited = 1;
}
static void bisect_common(struct rev_info *revs, const char *prefix,
int *reaches, int *all)
{
bisect_rev_setup(revs, prefix);
if (prepare_revision_walk(revs))
die("revision walk setup failed");
if (revs->tree_objects)
mark_edges_uninteresting(revs->commits, revs, NULL);
revs->commits = find_bisection(revs->commits, reaches, all,
!!skipped_sha1_nr);
}
int bisect_next_vars(const char *prefix)
{
struct rev_info revs;
......@@ -542,15 +556,7 @@ int bisect_next_vars(const char *prefix)
info.revs = &revs;
info.bisect_show_flags = BISECT_SHOW_TRIED | BISECT_SHOW_STRINGED;
bisect_rev_setup(&revs, prefix);
if (prepare_revision_walk(&revs))
die("revision walk setup failed");
if (revs.tree_objects)
mark_edges_uninteresting(revs.commits, &revs, NULL);
revs.commits = find_bisection(revs.commits, &reaches, &all,
!!skipped_sha1_nr);
bisect_common(&revs, prefix, &reaches, &all);
return show_bisect_vars(&info, reaches, all);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment