From: Junio C Hamano Date: Fri, 31 Jul 2026 15:54:03 +0000 (-0700) Subject: Merge branch 'jc/exclude-first-parent-seen' into jch X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aea8c58e71edacfefad29e94ca796176944e3f76;p=thirdparty%2Fgit.git Merge branch 'jc/exclude-first-parent-seen' into jch 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 --- aea8c58e71edacfefad29e94ca796176944e3f76 diff --cc revision.c index 8eb7cb9bbc,9b30663669..526bcf3fb5 --- a/revision.c +++ b/revision.c @@@ -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)