Merge branch 'jk/color-and-pager'
* jk/color-and-pager: want_color: automatically fallback to color.ui diff: don't load color config in plumbing config: refactor get_colorbool function color: delay auto-color decision until point of use git_config_colorbool: refactor stdout_is_tty handling diff: refactor COLOR_DIFF from a flag into an int setup_pager: set GIT_PAGER_IN_USE t7006: use test_config helpers test-lib: add helper functions for config t7006: modernize calls to unset Conflicts: builtin/commit.c parse-options.c
This commit is contained in:
@ -71,7 +71,7 @@ static int parse_branch_color_slot(const char *var, int ofs)
|
||||
static int git_branch_config(const char *var, const char *value, void *cb)
|
||||
{
|
||||
if (!strcmp(var, "color.branch")) {
|
||||
branch_use_color = git_config_colorbool(var, value, -1);
|
||||
branch_use_color = git_config_colorbool(var, value);
|
||||
return 0;
|
||||
}
|
||||
if (!prefixcmp(var, "color.branch.")) {
|
||||
@ -88,7 +88,7 @@ static int git_branch_config(const char *var, const char *value, void *cb)
|
||||
|
||||
static const char *branch_get_color(enum color_branch ix)
|
||||
{
|
||||
if (branch_use_color > 0)
|
||||
if (want_color(branch_use_color))
|
||||
return branch_colors[ix];
|
||||
return "";
|
||||
}
|
||||
@ -673,9 +673,6 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||
|
||||
git_config(git_branch_config, NULL);
|
||||
|
||||
if (branch_use_color == -1)
|
||||
branch_use_color = git_use_color_default;
|
||||
|
||||
track = git_branch_track;
|
||||
|
||||
head = resolve_ref("HEAD", head_sha1, 0, NULL);
|
||||
|
||||
Reference in New Issue
Block a user