aboutsummaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2023-06-28 19:26:20 +0000
committerJunio C Hamano <gitster@pobox.com>2023-06-28 14:06:38 -0700
commit97eeeea2dc069a1fcb03db99ef3810ebe3056188 (patch)
tree44d42f1a7533469948e7d5f181a34198ef109123 /builtin/grep.c
parent6ff334181cfb6485d3ba50843038209a2a253907 (diff)
downloadgit-97eeeea2dc069a1fcb03db99ef3810ebe3056188.tar.xz
config: inline git_color_default_config
git_color_default_config() is a shorthand for calling two other config callbacks. There are no other non-static functions that do this and it will complicate our refactoring of config_fn_t so inline it instead. Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index b86c754def..76cf999d31 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -293,7 +293,10 @@ static int wait_all(void)
static int grep_cmd_config(const char *var, const char *value, void *cb)
{
int st = grep_config(var, value, cb);
- if (git_color_default_config(var, value, NULL) < 0)
+
+ if (git_color_config(var, value, cb) < 0)
+ st = -1;
+ else if (git_default_config(var, value, cb) < 0)
st = -1;
if (!strcmp(var, "grep.threads")) {