From: Junio C Hamano Date: Sat, 25 Jul 2026 21:37:15 +0000 (-0700) Subject: Merge branch 'jc/exclude-first-parent-seen' into next X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85755d1d453e9f0946a4b0f4f708f1c41f2afedc;p=thirdparty%2Fgit.git Merge branch 'jc/exclude-first-parent-seen' into next 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 --- 85755d1d453e9f0946a4b0f4f708f1c41f2afedc 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)