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>
This commit is contained in:
Christian Couder 2007-09-20 07:23:01 +02:00 committed by Junio C Hamano
parent 077d6f72c7
commit 17ed158021

View file

@ -436,10 +436,10 @@ static struct commit_list *find_bisection(struct commit_list *list,
/* Do the real work of finding bisection commit. */ /* Do the real work of finding bisection commit. */
best = do_find_bisection(list, nr, weights); best = do_find_bisection(list, nr, weights);
if (best) if (best) {
best->next = NULL; best->next = NULL;
*reaches = weight(best);
*reaches = weight(best); }
free(weights); free(weights);
return best; return best;