From 92507a247b407b7d1ff02255b0335e735d9de188 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 12 Sep 2006 18:50:03 +0200 Subject: [PATCH] draw_rev_graph: refactor stuff to get_rev_graph_symbol --- tig.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tig.c b/tig.c index f3dc7b7..ce35f59 100644 --- a/tig.c +++ b/tig.c @@ -2746,13 +2746,11 @@ push_rev_graph(struct rev_graph *graph, char *parent) } } -static void -draw_rev_graph(struct rev_graph *graph) +static chtype +get_rev_graph_symbol(struct rev_graph *graph) { - chtype symbol, separator, line; - size_t i; + chtype symbol; - /* Place the symbol for this commit. */ if (graph->parents->size == 0) symbol = REVGRAPH_INIT; else if (graph->parents->size > 1) @@ -2762,6 +2760,16 @@ draw_rev_graph(struct rev_graph *graph) else symbol = REVGRAPH_COMMIT; + return symbol; +} + +static void +draw_rev_graph(struct rev_graph *graph) +{ + chtype separator, line; + chtype symbol = get_rev_graph_symbol(graph); + size_t i; + separator = ' '; line = REVGRAPH_LINE; @@ -2775,6 +2783,7 @@ draw_rev_graph(struct rev_graph *graph) append_to_rev_graph(graph, separator); } + /* Place the symbol for this revision. */ append_to_rev_graph(graph, symbol); if (graph->prev->size > graph->size) { -- 2.30.2