]> git.ipfire.org Git - thirdparty/git.git/commitdiff
grep.c: don't pass along NULL callback value
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 16 Feb 2022 00:00:35 +0000 (01:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Feb 2022 02:00:50 +0000 (18:00 -0800)
Change grep_cmd_config() to stop passing around the always-NULL "cb"
value. When this code was added in 7e8f59d577e (grep: color patterns
in output, 2009-03-07) it was non-NULL, but when that changed in
15fabd1bbd4 (builtin/grep.c: make configuration callback more
reusable, 2012-10-09) this code was left behind.

In a subsequent change I'll start using the "cb" value, this will make
it clear which functions we call need it, and which don't.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c

index d85cbabea67fbf90601fe7b76466c63b48a286bb..5ec4cecae458810592893e5240dca75e0787df29 100644 (file)
@@ -285,8 +285,8 @@ 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, cb) < 0)
+       int st = grep_config(var, value, NULL);
+       if (git_color_default_config(var, value, NULL) < 0)
                st = -1;
 
        if (!strcmp(var, "grep.threads")) {