summaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-04-19 09:55:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-05-10 07:30:28 (GMT)
commit2ace9727be2b04ce9fbc5939466da38be7fd8496 (patch)
tree835638ebb932a861938bd1455f3e105b920823c9 /bisect.c
parent280e65cbd83a867437cef3543d445013ecbfe29a (diff)
downloadgit-2ace9727be2b04ce9fbc5939466da38be7fd8496.zip
git-2ace9727be2b04ce9fbc5939466da38be7fd8496.tar.gz
git-2ace9727be2b04ce9fbc5939466da38be7fd8496.tar.bz2
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>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/bisect.c b/bisect.c
index 58f7e6f..0448eae 100644
--- a/bisect.c
+++ b/bisect.c
@@ -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);
}