]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/config: do not die in `get_color()`
authorPatrick Steinhardt <ps@pks.im>
Mon, 22 Sep 2025 13:06:20 +0000 (15:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Sep 2025 16:32:57 +0000 (09:32 -0700)
commit6e6ed3eaba315ceab0e0e9256474caac8520a819
tree26d34360aab3ed123d9b8b12554024a4983e1a42
parent7f89ad8c8c805b3b062d73d89c0763462a930e92
builtin/config: do not die in `get_color()`

When trying to parse an invalid color via `get_color()` we die. We're
about to introduce another caller in a subsequent commit though that has
its own error handling, so dying is a bit drastic there. Furthermore,
the only caller that we already have right now already knows to handle
errors in other branches that don't call `get_color()`.

Convert the function to instead return an error code to improve its
flexibility.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c