summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorLucian Poston <lucian.poston@gmail.com>2012-04-16 10:44:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-04-16 18:28:30 (GMT)
commit5e71a84a2da8f5dd32c13392854eab4d448c8085 (patch)
treef2fe98b17d67ffa9af3b22a4f37252eee2d30855 /graph.c
parent8c188c74e3f04ab75a42d43375a011f286cb1b66 (diff)
downloadgit-5e71a84a2da8f5dd32c13392854eab4d448c8085.zip
git-5e71a84a2da8f5dd32c13392854eab4d448c8085.tar.gz
git-5e71a84a2da8f5dd32c13392854eab4d448c8085.tar.bz2
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 <lucian.poston@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/graph.c b/graph.c
index 7358416..7e0a099 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;
}