]> git.ipfire.org Git - thirdparty/git.git/commitdiff
MyFirstObjectWalk: use additional arg in config_fn_t
authorDirk Gouders <dirk@gouders.net>
Wed, 27 Mar 2024 11:22:12 +0000 (12:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Mar 2024 16:24:34 +0000 (09:24 -0700)
Commit a4e7e317f8 (config: add ctx arg to config_fn_t, 2023-06-28)
added a fourth argument to config_fn_t but did not change relevant
function calls in Documentation/MyFirstObjectWalk.txt.

Fix those calls and the example git_walken_config() to use
that additional argument.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/MyFirstObjectWalk.txt

index c68cdb11b9d5a53ddc11361d0f1c889edeb24536..cceac2df952d5de8ea7e1588863eef4881b78f34 100644 (file)
@@ -210,13 +210,14 @@ We'll also need to include the `config.h` header:
 
 ...
 
-static int git_walken_config(const char *var, const char *value, void *cb)
+static int git_walken_config(const char *var, const char *value,
+                            const struct config_context *ctx, void *cb)
 {
        /*
         * For now, we don't have any custom configuration, so fall back to
         * the default config.
         */
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 ----
 
@@ -389,10 +390,11 @@ modifying `rev_info.grep_filter`, which is a `struct grep_opt`.
 First some setup. Add `grep_config()` to `git_walken_config()`:
 
 ----
-static int git_walken_config(const char *var, const char *value, void *cb)
+static int git_walken_config(const char *var, const char *value,
+                            const struct config_context *ctx, void *cb)
 {
-       grep_config(var, value, cb);
-       return git_default_config(var, value, cb);
+       grep_config(var, value, ctx, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 ----