summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 778e60b)
raw | patch | inline | side by side (parent: 778e60b)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 16 Sep 2006 12:12:41 +0000 (14:12 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Sat, 16 Sep 2006 12:13:42 +0000 (14:13 +0200) |
Now atleast there will not be unconnected lines at the end of the graph.
tig.c | patch | blob | history |
index 4e06fa52c5030f3e6f297b501593a2b353f7bbdd..1e033c607d041bbec20f272598dca9a6f4d6ef15 100644 (file)
--- a/tig.c
+++ b/tig.c
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);