config: move flockfile() closer to unlocked functions
[gitweb.git] / bisect.c
index b1941505b236b5cb56ea7fe757dab215dcf2bb07..3756f127b0fbaee3959011dbcd2beebbf067c5af 100644 (file)
--- 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);