From: Christian Couder Date: Thu, 20 Sep 2007 05:23:01 +0000 (+0200) Subject: rev-list --bisect: Fix best == NULL case. X-Git-Tag: v1.5.4-rc0~424 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=17ed158021ead9cb056f692fc35ff3fcde96a747;p=git.git 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 --- 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;