X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fshow-branch.c;h=4b480d7c7ca6c6258a5cd82cfc88df62cd0d218f;hb=bd193f46b70fd3f8a55e2a8dcbb1fb2b4eec13d6;hp=facc63a79ec0c86fd9df59792cd4f20030af5db1;hpb=58f75bcf323e86067147ac66bbb493e6a8c2631f;p=git.git diff --git a/builtin/show-branch.c b/builtin/show-branch.c index facc63a79..4b480d7c7 100644 --- a/builtin/show-branch.c +++ b/builtin/show-branch.c @@ -26,14 +26,14 @@ static const char **default_arg; static const char *get_color_code(int idx) { - if (showbranch_use_color) + if (want_color(showbranch_use_color)) return column_colors_ansi[idx % column_colors_ansi_max]; return ""; } static const char *get_color_reset_code(void) { - if (showbranch_use_color) + if (want_color(showbranch_use_color)) return GIT_COLOR_RESET; return ""; } @@ -573,7 +573,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb) } if (!strcmp(var, "color.showbranch")) { - showbranch_use_color = git_config_colorbool(var, value, -1); + showbranch_use_color = git_config_colorbool(var, value); return 0; } @@ -685,9 +685,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) git_config(git_show_branch_config, NULL); - if (showbranch_use_color == -1) - showbranch_use_color = git_use_color_default; - /* If nothing is specified, try the default first */ if (ac == 1 && default_num) { ac = default_num;