From 5e71a84a2da8f5dd32c13392854eab4d448c8085 Mon Sep 17 00:00:00 2001 From: Lucian Poston Date: Mon, 16 Apr 2012 03:44:50 -0700 Subject: Add output_prefix_length to diff_options Add output_prefix_length to diff_options. Initialize the value to 0 and only set it when graph.c:diff_output_prefix_callback() is called. Signed-off-by: Lucian Poston Signed-off-by: Junio C Hamano --- graph.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'graph.c') diff --git a/graph.c b/graph.c index 7358416a7..7e0a099f8 100644 --- 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; } -- cgit v1.2.1