]> Kevux Git Server - rit/commit
color: add color_parse_quietly()
authorDerrick Stolee <stolee@gmail.com>
Mon, 23 Feb 2026 12:26:52 +0000 (12:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Feb 2026 21:23:41 +0000 (13:23 -0800)
commitdb45e4908d6711ddc3094cb079c85278691c8267
tree1d9f809d42a599a62bf21320db042a32eb518893
parent9cb4a5e1ba3e586e77b1c026d509f284b4c55764
color: add color_parse_quietly()

When parsing colors, a failed parse leads to an error message due to the
result returning error(). To allow for quiet parsing, create
color_parse_quietly(). This is in contrast to an ..._gently() version
because the original does not die(), so both options are technically
'gentle'.

To accomplish this, convert the implementation of color_parse_mem() into
a static color_parse_mem_1() helper that adds a 'quiet' parameter. The
color_parse_quietly() method can then use this. Since it is a near
equivalent to color_parse(), move that method down in the file so they
can be nearby while also appearing after color_parse_mem_1().

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
color.c
color.h