aboutsummaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-05 17:26:11 -0800
committerJunio C Hamano <gitster@pobox.com>2007-12-05 17:57:11 -0800
commit0f6f5a4022de5904926cd528c681468e3f635256 (patch)
treeee37c3b7e05ff21f223508ce71ff3cc3f862f32e /builtin-branch.c
parentcec99d8cef12d18c71b277a4cd6963d37b13e901 (diff)
downloadgit-0f6f5a4022de5904926cd528c681468e3f635256.tar.gz
git-0f6f5a4022de5904926cd528c681468e3f635256.tar.xz
git config --get-colorbool
This adds an option to help scripts find out color settings from the configuration file. git config --get-colorbool color.diff inspects color.diff variable, and exits with status 0 (i.e. success) if color is to be used. It exits with status 1 otherwise. If a script wants "true"/"false" answer to the standard output of the command, it can pass an additional boolean parameter to its command line, telling if its standard output is a terminal, like this: git config --get-colorbool color.diff true When called like this, the command outputs "true" to its standard output if color is to be used (i.e. "color.diff" says "always", "auto", or "true"), and "false" otherwise. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index c64768beb..089cae592 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -65,7 +65,7 @@ static int parse_branch_color_slot(const char *var, int ofs)
static int git_branch_config(const char *var, const char *value)
{
if (!strcmp(var, "color.branch")) {
- branch_use_color = git_config_colorbool(var, value);
+ branch_use_color = git_config_colorbool(var, value, -1);
return 0;
}
if (!prefixcmp(var, "color.branch.")) {