summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-09-29 11:40:35 -0700
committerJunio C Hamano <gitster@pobox.com>2025-09-29 11:40:35 -0700
commita89fa2fff2e2e5c13df0caccd913427b5c98a4b4 (patch)
treeedcb0bee38f7654abbe08b40aaf2df85061cd2df /log-tree.c
parenta5d4779e6ed1bebf56ab90bd264e437ac2232b98 (diff)
parent69a7e8d32f37ca9cefc6b82fe848415d1d4200d9 (diff)
Merge branch 'jk/color-variable-fixes'
Some places in the code confused a variable that is *not* a boolean to enable color but is an enum that records what the user requested to do about color. A couple of bugs of this sort have been fixed, while the code has been cleaned up to prevent similar bugs in the future. * jk/color-variable-fixes: config: store want_color() result in a separate bool add-interactive: retain colorbool values longer color: return bool from want_color() color: use git_colorbool enum type to store colorbools pretty: use format_commit_context.auto_color as colorbool diff: stop passing ecbdata->use_color as boolean diff: pass o->use_color directly to fill_metainfo() diff: don't use diff_options.use_color as a strict bool diff: simplify color_moved check when flushing grep: don't treat grep_opt.color as a strict bool color: return enum from git_config_colorbool() color: use GIT_COLOR_* instead of numeric constants
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/log-tree.c b/log-tree.c
index 73d21f7176..67d9ace596 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -57,7 +57,7 @@ static const char *color_decorate_slots[] = {
[DECORATION_GRAFTED] = "grafted",
};
-static const char *decorate_get_color(int decorate_use_color, enum decoration_type ix)
+static const char *decorate_get_color(enum git_colorbool decorate_use_color, enum decoration_type ix)
{
if (want_color(decorate_use_color))
return decoration_colors[ix];
@@ -341,7 +341,7 @@ static void show_name(struct strbuf *sb, const struct name_decoration *decoratio
*/
void format_decorations(struct strbuf *sb,
const struct commit *commit,
- int use_color,
+ enum git_colorbool use_color,
const struct decoration_options *opts)
{
const struct name_decoration *decoration;