From: Lars Hjemli Date: Mon, 12 May 2008 15:12:36 +0000 (+0200) Subject: revision.c: really honor --first-parent X-Git-Tag: v1.5.6-rc0~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad1012ebde8be471098b5d476a98a02c76c8e75a;p=thirdparty%2Fgit.git revision.c: really honor --first-parent In add_parents_to_list, if any parent of a revision had already been SEEN, the current code would continue with the next parent, skipping the test for --first-parent. This patch inverts the test for SEEN so that the test for --first-parent is always performed. Signed-off-by: Lars Hjemli Signed-off-by: Junio C Hamano --- diff --git a/revision.c b/revision.c index bcfcd2a82b..6f5b548a32 100644 --- a/revision.c +++ b/revision.c @@ -467,10 +467,10 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit, str if (parse_commit(p) < 0) return -1; p->object.flags |= left_flag; - if (p->object.flags & SEEN) - continue; - p->object.flags |= SEEN; - insert_by_date(p, list); + if (!(p->object.flags & SEEN)) { + p->object.flags |= SEEN; + insert_by_date(p, list); + } if(revs->first_parent_only) break; }