From 17ed158021ead9cb056f692fc35ff3fcde96a747 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Thu, 20 Sep 2007 07:23:01 +0200 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- builtin-rev-list.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 899a31d09..389463399 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -436,10 +436,10 @@ static struct commit_list *find_bisection(struct commit_list *list, /* Do the real work of finding bisection commit. */ best = do_find_bisection(list, nr, weights); - if (best) + if (best) { best->next = NULL; - - *reaches = weight(best); + *reaches = weight(best); + } free(weights); return best; -- 2.30.2