mirror of
https://github.com/git/git.git
synced 2024-11-27 20:14:30 +08:00
Merge branch 'mk/color'
* mk/color: Use color.ui variable in scripts too
This commit is contained in:
commit
dc46fa36b8
@ -144,6 +144,8 @@ See also <<FILES>>.
|
||||
"auto". If `stdout-is-tty` is missing, then checks the standard
|
||||
output of the command itself, and exits with status 0 if color
|
||||
is to be used, or exits with status 1 otherwise.
|
||||
When the color setting for `name` is undefined, the command uses
|
||||
`color.ui` as fallback.
|
||||
|
||||
--get-color name default::
|
||||
|
||||
|
@ -240,6 +240,10 @@ static int git_get_colorbool_config(const char *var, const char *value)
|
||||
get_diff_color_found =
|
||||
git_config_colorbool(var, value, stdout_is_tty);
|
||||
}
|
||||
if (!strcmp(var, "color.ui")) {
|
||||
git_use_color_default = git_config_colorbool(var, value, stdout_is_tty);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -267,7 +271,7 @@ static int get_colorbool(int argc, const char **argv)
|
||||
if (!strcmp(get_color_slot, "color.diff"))
|
||||
get_colorbool_found = get_diff_color_found;
|
||||
if (get_colorbool_found < 0)
|
||||
get_colorbool_found = 0;
|
||||
get_colorbool_found = git_use_color_default;
|
||||
}
|
||||
|
||||
if (argc == 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user