Skip to content

Commit

Permalink
rev-list --bisect: Fix best == NULL case.
Browse files Browse the repository at this point in the history
Earlier commit ce0cbad 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>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Sep 20, 2007
1 parent 077d6f7 commit 17ed158
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin-rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 17ed158

Please sign in to comment.