@matheusbsbs / matheus-bagliano / commits / 17ed158021
Fork 0

rev-list --bisect: Fix best == NULL case.

Earlier commit ce0cbad77 broke rev-list --bisect to cause it segfault when the resulting set is empty. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Sep 20, 2007 at 07:23 UTC 17ed158021ead9cb056f692fc35ff3fcde96a747
1 file changed +3 -3
builtin-rev-list.c
+3 -3
@@ -436,10 +436,10 @@ static struct commit_list *find_bisection(struct commit_list *list,
436 /* Do the real work of finding bisection commit. */
437 best = do_find_bisection(list, nr, weights);
438
439 - if (best)
439 + if (best) {
440 best->next = NULL;
441 -
442 - *reaches = weight(best);
441 + *reaches = weight(best);
442 + }
443 free(weights);
444
445 return best;