From 17ed158021ead9cb056f692fc35ff3fcde96a747 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Thu, 20 Sep 2007 07:23:01 +0200 Subject: 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 899a31d..3894633 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; -- cgit v0.10.2-6-g49f6