summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorLibravatar Michael J Gruber <git@drmicha.warpmail.net>2011-03-07 13:31:39 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-03-09 13:50:54 -0800
commit1df2d656cc442dc057e30b6fb130967e5ae19654 (patch)
tree6290981baed52c65c997e7e0eb172651d9af26ff /pretty.c
parentrev-list: --left/right-only are mutually exclusive (diff)
downloadtgif-1df2d656cc442dc057e30b6fb130967e5ae19654.tar.xz
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 <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c6
1 files changed, 1 insertions, 5 deletions
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);