{"thread":{"id":"18948","subject":"[PATCH 3/5] bisect: move common bisect functionality in \"bisect_common\"","startedAt":"2009-04-19T09:55:57Z","lastAt":"2009-04-19T09:55:57Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"111638","messageId":"20090419115557.58efa4fe.chriscool@tuxfamily.org","threadId":"18948","inReplyTo":null,"subject":"[PATCH 3/5] bisect: move common bisect functionality in \"bisect_common\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-04-19T09:55:57Z","receivedAt":"2009-04-19T09:55:57Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"So we can easily reuse the code in a later patch.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n bisect.c |   24 +++++++++++++++---------\n 1 files changed, 15 insertions(+), 9 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 58f7e6f..0448eae 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -532,6 +532,20 @@ static void bisect_rev_setup(struct rev_info *revs, const char *prefix)\n \trevs->limited = 1;\n }\n \n+static void bisect_common(struct rev_info *revs, const char *prefix,\n+\t\t\t  int *reaches, int *all)\n+{\n+\tbisect_rev_setup(revs, prefix);\n+\n+\tif (prepare_revision_walk(revs))\n+\t\tdie(\"revision walk setup failed\");\n+\tif (revs->tree_objects)\n+\t\tmark_edges_uninteresting(revs->commits, revs, NULL);\n+\n+\trevs->commits = find_bisection(revs->commits, reaches, all,\n+\t\t\t\t       !!skipped_sha1_nr);\n+}\n+\n int bisect_next_vars(const char *prefix)\n {\n \tstruct rev_info revs;\n@@ -542,15 +556,7 @@ int bisect_next_vars(const char *prefix)\n \tinfo.revs = &revs;\n \tinfo.bisect_show_flags = BISECT_SHOW_TRIED | BISECT_SHOW_STRINGED;\n \n-\tbisect_rev_setup(&revs, prefix);\n-\n-\tif (prepare_revision_walk(&revs))\n-\t\tdie(\"revision walk setup failed\");\n-\tif (revs.tree_objects)\n-\t\tmark_edges_uninteresting(revs.commits, &revs, NULL);\n-\n-\trevs.commits = find_bisection(revs.commits, &reaches, &all,\n-\t\t\t\t      !!skipped_sha1_nr);\n+\tbisect_common(&revs, prefix, &reaches, &all);\n \n \treturn show_bisect_vars(&info, reaches, all);\n }\n-- \n1.6.2.2.537.g3b83b\n"}]}