From 1df2d656cc442dc057e30b6fb130967e5ae19654 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 7 Mar 2011 13:31:39 +0100 Subject: rev-list/log: factor out revision mark generation Currently, we have identical code for generating revision marks ('<', '>', '-') in 5 places. Factor out the code to a single function get_revision_mark() for easier maintenance and extensibility. Note that the check for !!revs in graph.c (which gets removed effectively by this patch) is superfluous. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- pretty.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'pretty.c') diff --git a/pretty.c b/pretty.c index 8549934751..f21a30ccca 100644 --- a/pretty.c +++ b/pretty.c @@ -859,11 +859,7 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder, c->abbrev_parent_hashes.off; return 1; case 'm': /* left/right/bottom */ - strbuf_addch(sb, (commit->object.flags & BOUNDARY) - ? '-' - : (commit->object.flags & SYMMETRIC_LEFT) - ? '<' - : '>'); + strbuf_addstr(sb, get_revision_mark(NULL, commit)); return 1; case 'd': format_decoration(sb, commit); -- cgit v1.2.1