From: Jonas Fonseca Date: Tue, 12 Sep 2006 16:25:53 +0000 (+0200) Subject: Simplify the update_rev_graph end-game X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=375650cf691b46f7c45b47791eb654d98d115a1a;p=tig.git Simplify the update_rev_graph end-game --- diff --git a/tig.c b/tig.c index 0ec81b8..cc3dc50 100644 --- a/tig.c +++ b/tig.c @@ -2925,19 +2925,21 @@ update_rev_graph(struct rev_stack *graph) draw_rev_graph(graph); - if (graph_parent_is_merge(graph->prev) && - graph->prev->pos < graph->prev->size - 1 && - graph->size == graph->prev->size + graph->prev->parents->size - 1) { - i = graph->prev->pos + graph->prev->parents->size - 1; - graph->prev->commit->graph_size = i * 2; - while (i < graph->size - 1) { - append_to_rev_graph(graph->prev, ' '); - append_to_rev_graph(graph->prev, '\\'); + graph = graph->prev; + + if (graph_parent_is_merge(graph) && + graph->pos < graph->size - 1 && + graph->next->size == graph->size + graph->parents->size - 1) { + i = graph->pos + graph->parents->size - 1; + graph->commit->graph_size = i * 2; + while (i < graph->next->size - 1) { + append_to_rev_graph(graph, ' '); + append_to_rev_graph(graph, '\\'); i++; } } - reset_rev_graph(graph->prev); + reset_rev_graph(graph); } /* Reads git log --pretty=raw output and parses it into the commit struct. */