filter_refs(): simplify logic
[gitweb.git] / graph.c
diff --git a/graph.c b/graph.c
index 2f6893dc4f97dfbccad6f22f66861c24021a3c46..7e0a099f8329757b24770ec6788bf83a8398d76d 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -194,8 +194,10 @@ static struct strbuf *diff_output_prefix_callback(struct diff_options *opt, void
        struct git_graph *graph = data;
        static struct strbuf msgbuf = STRBUF_INIT;
 
+       assert(opt);
        assert(graph);
 
+       opt->output_prefix_length = graph->width;
        strbuf_reset(&msgbuf);
        graph_padding_line(graph, &msgbuf);
        return &msgbuf;
@@ -245,6 +247,7 @@ struct git_graph *graph_init(struct rev_info *opt)
         */
        opt->diffopt.output_prefix = diff_output_prefix_callback;
        opt->diffopt.output_prefix_data = graph;
+       opt->diffopt.output_prefix_length = 0;
 
        return graph;
 }
@@ -347,7 +350,7 @@ static struct commit_list *first_interesting_parent(struct git_graph *graph)
 
 static unsigned short graph_get_current_column_color(const struct git_graph *graph)
 {
-       if (!DIFF_OPT_TST(&graph->revs->diffopt, COLOR_DIFF))
+       if (!want_color(graph->revs->diffopt.use_color))
                return column_colors_max;
        return graph->default_column_color;
 }