summaryrefslogtreecommitdiff
path: root/builtin-rev-list.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2007-09-20 07:23:01 +0200
committerJunio C Hamano <gitster@pobox.com>2007-09-20 00:10:48 -0700
commit17ed158021ead9cb056f692fc35ff3fcde96a747 (patch)
tree6ccdca4a789bc9546632273b0449254af0550191 /builtin-rev-list.c
parent077d6f72c7db84d2b6b3db879e3d68ab60482d43 (diff)
downloadgit-17ed158021ead9cb056f692fc35ff3fcde96a747.tar.gz
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>
Diffstat (limited to 'builtin-rev-list.c')
-rw-r--r--builtin-rev-list.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 899a31d09a..3894633999 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;