summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 375650c)
raw | patch | inline | side by side (parent: 375650c)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 12 Sep 2006 16:31:46 +0000 (18:31 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Tue, 12 Sep 2006 16:31:46 +0000 (18:31 +0200) |
tig.c | patch | blob | history |
index cc3dc50fbd2609a2e676d0b9bd5aacc2b2f67727..d1d63da05b3b6c30449ec54058d97d1d0fdf7652 100644 (file)
--- a/tig.c
+++ b/tig.c
return graph->parents->size > 1;
}
-static void
-reset_rev_graph(struct rev_stack *graph)
-{
- graph->size = graph->pos = 0;
- graph->commit = NULL;
- memset(graph->parents, 0, sizeof(*graph->parents));
-}
-
static inline void
append_to_rev_graph(struct rev_stack *stack, chtype symbol)
{
stack->commit->graph[stack->commit->graph_size++] = symbol;
}
+static void
+done_rev_graph(struct rev_stack *graph)
+{
+ if (graph_parent_is_merge(graph) &&
+ graph->pos < graph->size - 1 &&
+ graph->next->size == graph->size + graph->parents->size - 1) {
+ size_t 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++;
+ }
+ }
+
+ graph->size = graph->pos = 0;
+ graph->commit = NULL;
+ memset(graph->parents, 0, sizeof(*graph->parents));
+}
+
static void
push_rev_stack(struct rev_stack *stack, char *parent)
{
push_rev_stack(graph->next, graph->rev[i]);
draw_rev_graph(graph);
-
- 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);
+ done_rev_graph(graph->prev);
}
/* Reads git log --pretty=raw output and parses it into the commit struct. */