From 2fe894e6391aeb6124902a5030dc2776877824fc Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 16 Sep 2006 14:12:41 +0200 Subject: [PATCH] push_rev_graph: iterate all graph revs when looking for duplicates Now atleast there will not be unconnected lines at the end of the graph. --- tig.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tig.c b/tig.c index 4e06fa5..1e033c6 100644 --- a/tig.c +++ b/tig.c @@ -2758,10 +2758,15 @@ done_rev_graph(struct rev_graph *graph) static void push_rev_graph(struct rev_graph *graph, char *parent) { - /* Combine duplicate parents lines. */ - if (graph->size > 0 && - !strncmp(graph->rev[graph->size - 1], parent, SIZEOF_REV)) - return; + int i; + + /* "Collapse" duplicate parents lines. + * + * FIXME: This needs to also update update the drawn graph but + * for now it just serves as a method for pruning graph lines. */ + for (i = 0; i < graph->size; i++) + if (!strncmp(graph->rev[i], parent, SIZEOF_REV)) + return; if (graph->size < SIZEOF_REVITEMS) { string_ncopy(graph->rev[graph->size++], parent, SIZEOF_REV); -- 2.30.2