Merge branch 'ds/reachable-first-parent-fix'
authorJunio C Hamano <gitster@pobox.com>
Tue, 30 Oct 2018 06:43:44 +0000 (15:43 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Oct 2018 06:43:44 +0000 (15:43 +0900)
Correct performance regression in commit ancestry computation when
generation numbers are involved.

* ds/reachable-first-parent-fix:
commit-reach: fix first-parent heuristic

commit-reach.c
index 9f79ce0a22946174376d247127027e4a0ad3c1e9..79419be8aff7426ec435f040b88f8e91040b71f4 100644 (file)
@@ -593,8 +593,10 @@ int can_all_from_reach_with_flag(struct object_array *from,
                while (stack) {
                        struct commit_list *parent;
 
-                       if (stack->item->object.flags & with_flag) {
+                       if (stack->item->object.flags & (with_flag | RESULT)) {
                                pop_commit(&stack);
+                               if (stack)
+                                       stack->item->object.flags |= RESULT;
                                continue;
                        }