]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/exclude-first-parent-seen' into jch
authorJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:40:40 +0000 (10:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:40:40 +0000 (10:40 -0700)
Traversals with '--exclude-first-parent-only' have been corrected to
properly stop after the first parent even when it has already been
marked as SEEN.

* jc/exclude-first-parent-seen:
  revision: honor --exclude-first-parent-only with SEEN first parent

1  2 
revision.c

diff --cc revision.c
index 8eb7cb9bbccd1e8a578a923049cff80e6c327bc5,9b306636697242ec85f82bfcbca7dea8e2882586..526bcf3fb5aeb9484814c37a6b1917c3c56641c9
@@@ -1153,13 -1152,21 +1153,19 @@@ static int process_parents(struct rev_i
                        if (p)
                                p->object.flags |= UNINTERESTING |
                                                   CHILD_VISITED;
-                       if (repo_parse_commit_gently(revs->repo, p, 1) < 0)
+                       if (repo_parse_commit_gently(revs->repo, p, 1) < 0) {
+                               if (revs->exclude_first_parent_only)
+                                       break;
                                continue;
+                       }
                        if (p->parents)
                                mark_parents_uninteresting(revs, p);
-                       if (p->object.flags & SEEN)
+                       if (p->object.flags & SEEN) {
+                               if (revs->exclude_first_parent_only)
+                                       break;
                                continue;
+                       }
                        p->object.flags |= (SEEN | NOT_USER_GIVEN);
 -                      if (list)
 -                              commit_list_insert_by_date(p, list);
                        if (queue)
                                prio_queue_put(queue, p);
                        if (revs->exclude_first_parent_only)