aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2008-05-12 17:12:36 +0200
committerJunio C Hamano <gitster@pobox.com>2008-05-12 16:24:51 -0700
commitad1012ebde8be471098b5d476a98a02c76c8e75a (patch)
treea19a3311e4beb6175be0f0e484c083af84ea0fce /revision.c
parentd9c292e8bbd51c84cb9ecd86cb89b8a1b35a2a82 (diff)
downloadgit-ad1012ebde8be471098b5d476a98a02c76c8e75a.tar.gz
git-ad1012ebde8be471098b5d476a98a02c76c8e75a.tar.xz
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 <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/revision.c b/revision.c
index bcfcd2a82..6f5b548a3 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;
}