path: root/graph.c
diff options
authorJeff King <>2011-08-18 05:03:12 (GMT)
committerJunio C Hamano <>2011-08-18 21:35:53 (GMT)
commitf1c9626105d5e4962a5ccaa4620114d03f32ad02 (patch)
treed777e2316283c1972844977c821091dd77fd6262 /graph.c
parent2e6c012e10fd866eb3259de3a929e0296daabbaf (diff)
diff: refactor COLOR_DIFF from a flag into an int
This lets us store more than just a bit flag for whether we want color; we can also store whether we want automatic colors. This can be useful for making the automatic-color decision closer to the point of use. This mostly just involves replacing DIFF_OPT_* calls with manipulations of the flag. The biggest exception is that calls to DIFF_OPT_TST must check for "o->use_color > 0", which lets an "unknown" value (i.e., the default) stay at "no color". In the previous code, a value of "-1" was not propagated at all. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'graph.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/graph.c b/graph.c
index 2f6893d..556834a 100644
--- a/graph.c
+++ b/graph.c
@@ -347,7 +347,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 (graph->revs->diffopt.use_color <= 0)
return column_colors_max;
return graph->default_column_color;