rev-list: pass "revs" to "show_bisect_vars"
instead of using static "revs" data Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Mar 26, 2009 at 05:55 UTC
7428d754e2dec9e82253d1e02b4df20fab3f3384
2 files changed
+9
-7
bisect.h
+2
-1
@@ -5,6 +5,7 @@ extern struct commit_list *find_bisection(struct commit_list *list,
5
int *reaches, int *all,
6
int find_all);
7
8
-extern int show_bisect_vars(int reaches, int all, int show_all);
8
+extern int show_bisect_vars(struct rev_info *revs, int reaches, int all,
9
+ int show_all);
10
11
#endif
builtin-rev-list.c
+7
-6
@@ -226,16 +226,16 @@ static int estimate_bisect_steps(int all)
226
return (e < 3 * x) ? n : n - 1;
227
}
228
229
-int show_bisect_vars(int reaches, int all, int show_all)
229
+int show_bisect_vars(struct rev_info *revs, int reaches, int all, int show_all)
230
{
231
int cnt;
232
char hex[41];
233
234
- if (!revs.commits)
234
+ if (!revs->commits)
235
return 1;
236
237
/*
238
- * revs.commits can reach "reaches" commits among
238
+ * revs->commits can reach "reaches" commits among
239
* "all" commits. If it is good, then there are
240
* (all-reaches) commits left to be bisected.
241
* On the other hand, if it is bad, then the set
@@ -247,10 +247,10 @@ int show_bisect_vars(int reaches, int all, int show_all)
247
if (cnt < reaches)
248
cnt = reaches;
249
250
- strcpy(hex, sha1_to_hex(revs.commits->item->object.sha1));
250
+ strcpy(hex, sha1_to_hex(revs->commits->item->object.sha1));
251
252
if (show_all) {
253
- traverse_commit_list(&revs, show_commit, show_object);
253
+ traverse_commit_list(revs, show_commit, show_object);
254
printf("------\n");
255
}
256
@@ -358,7 +358,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
358
revs.commits = find_bisection(revs.commits, &reaches, &all,
359
bisect_find_all);
360
if (bisect_show_vars)
361
- return show_bisect_vars(reaches, all, bisect_find_all);
361
+ return show_bisect_vars(&revs, reaches, all,
362
+ bisect_find_all);
363
}
364
365
traverse_commit_list(&revs,