From e269eb7946d0a4ba6a4e175133b5479446ac04a5 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 17 Aug 2011 22:03:48 -0700 Subject: git_config_colorbool: refactor stdout_is_tty handling Usually this function figures out for itself whether stdout is a tty. However, it has an extra parameter just to allow git-config to override the auto-detection for its --get-colorbool option. Instead of an extra parameter, let's just use a global variable. This makes calling easier in the common case, and will make refactoring the colorbool code much simpler. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- parse-options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse-options.c') diff --git a/parse-options.c b/parse-options.c index 73bd28ad90..12a5b25d09 100644 --- a/parse-options.c +++ b/parse-options.c @@ -620,7 +620,7 @@ int parse_opt_color_flag_cb(const struct option *opt, const char *arg, if (!arg) arg = unset ? "never" : (const char *)opt->defval; - value = git_config_colorbool(NULL, arg, -1); + value = git_config_colorbool(NULL, arg); if (value < 0) return opterror(opt, "expects \"always\", \"auto\", or \"never\"", 0); -- cgit v1.2.3