Thread (9 messages) flat view 9 messages, 3 authors, 2016-06-15
DORMANTno replies

[PATCH] revision.c: really honor --first-parent

From: Lars Hjemli <hidden>
Date: 2016-06-15 22:44:36
Subsystem: the rest · Maintainer: Linus Torvalds

In add_parents_to_list, if any parent of a revision had already been
SEEN, the current code would continue with the next parent. But if the
first parent has been SEEN and --first-parent has been specified we need
to break, not continue.

Signed-off-by: Lars Hjemli <redacted>
---
 revision.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/revision.c b/revision.c
index 44d780b..974ad10 100644
--- a/revision.c
+++ b/revision.c
@@ -468,8 +468,11 @@ 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)
+		if (p->object.flags & SEEN) {
+			if (revs->first_parent_only)
+				break;
 			continue;
+		}
 		p->object.flags |= SEEN;
 		insert_by_date(p, list);
 		if(revs->first_parent_only)
-- 
1.5.5.1.148.g8ee22.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help