From: Jonas Fonseca Date: Tue, 12 Sep 2006 16:50:03 +0000 (+0200) Subject: draw_rev_graph: refactor stuff to get_rev_graph_symbol X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=92507a247b407b7d1ff02255b0335e735d9de188;p=tig.git draw_rev_graph: refactor stuff to get_rev_graph_symbol --- 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) {