From f1c9626105d5e4962a5ccaa4620114d03f32ad02 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 17 Aug 2011 22:03:12 -0700 Subject: 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 --- builtin/merge.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'builtin') diff --git a/builtin/merge.c b/builtin/merge.c index 325891edb6..7209edf76a 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -390,8 +390,6 @@ static void finish(const unsigned char *new_head, const char *msg) opts.output_format |= DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT; opts.detect_rename = DIFF_DETECT_RENAME; - if (diff_use_color_default > 0) - DIFF_OPT_SET(&opts, COLOR_DIFF); if (diff_setup_done(&opts) < 0) die(_("diff_setup_done failed")); diff_tree_sha1(head, new_head, "", &opts); -- cgit v1.2.3