X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff.c;h=dfdfa1a813c345b7653b1743afa75ff15d8c379f;hb=53997a30f8138f41d1d9c7a45e84106cc21c0558;hp=0d465faa1e546382267dc0779116a013647ecf41;hpb=89cd4aa8624de4fa80469ab9ef8482f44b2cc2db;p=git.git diff --git a/diff.c b/diff.c index 0d465faa1..dfdfa1a81 100644 --- a/diff.c +++ b/diff.c @@ -2826,6 +2826,15 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) DIFF_OPT_SET(options, FOLLOW_RENAMES); else if (!strcmp(arg, "--color")) DIFF_OPT_SET(options, COLOR_DIFF); + else if (!prefixcmp(arg, "--color=")) { + int value = git_config_colorbool(NULL, arg+8, -1); + if (value == 0) + DIFF_OPT_CLR(options, COLOR_DIFF); + else if (value > 0) + DIFF_OPT_SET(options, COLOR_DIFF); + else + return error("option `color' expects \"always\", \"auto\", or \"never\""); + } else if (!strcmp(arg, "--no-color")) DIFF_OPT_CLR(options, COLOR_DIFF); else if (!strcmp(arg, "--color-words")) {