git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH 3/5] bisect: move common bisect functionality in "bisect_common"
Date: Sun, 19 Apr 2009 11:55:57 +0200	[thread overview]
Message-ID: <20090419115557.58efa4fe.chriscool@tuxfamily.org> (raw)

So we can easily reuse the code in a later patch.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 bisect.c |   24 +++++++++++++++---------
 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);
 }
-- 
1.6.2.2.537.g3b83b

                 reply	other threads:[~2009-04-19  9:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090419115557.58efa4fe.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).