summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bisect.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bisect.c b/bisect.c
index b1941505b2..3756f127b0 100644
--- a/bisect.c
+++ b/bisect.c
@@ -399,8 +399,12 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
/* Do the real work of finding bisection commit. */
best = do_find_bisection(list, nr, weights, find_all);
if (best) {
- if (!find_all)
+ if (!find_all) {
+ list->item = best->item;
+ free_commit_list(list->next);
+ best = list;
best->next = NULL;
+ }
*reaches = weight(best);
}
free(weights);