chiark / gitweb /
draw_rev_graph: refactor stuff to get_rev_graph_symbol
authorJonas Fonseca <fonseca@diku.dk>
Tue, 12 Sep 2006 16:50:03 +0000 (18:50 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Tue, 12 Sep 2006 16:50:03 +0000 (18:50 +0200)
tig.c

diff --git a/tig.c b/tig.c
index f3dc7b78785338aef17c2a8ba05a117f812332d4..ce35f5925135c11c1759b86540332ff5e4d10931 100644 (file)
--- 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) {