drop pure pass-through config callbacks

Commit fd2d4c135e (gpg-interface: lazily initialize and read the configuration, 2023-02-09) shrunk a few custom config callbacks so that they are just one-liners of: return git_default_config(...); We can drop them entirely and replace them direct calls of git_default_config() intead. This makes the code a little shorter and easier to understand (with the downside being that if they do grow custom options again later, we'll have to recreate the functions). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Feb 26, 2023 at 17:40 UTC cc5d1d32fd489f7eb98f762de303b499f2117638
4 files changed +4 -24
builtin/am.c
+1 -6
@@ -2312,11 +2312,6 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
2312 return 0;
2313 }
2314
2315 -static int git_am_config(const char *k, const char *v, void *cb UNUSED)
2316 -{
2317 - return git_default_config(k, v, NULL);
2318 -}
2319 -
2315 int cmd_am(int argc, const char **argv, const char *prefix)
2316 {
2317 struct am_state state;
@@ -2440,7 +2435,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2435 if (argc == 2 && !strcmp(argv[1], "-h"))
2436 usage_with_options(usage, options);
2437
2443 - git_config(git_am_config, NULL);
2438 + git_config(git_default_config, NULL);
2439
2440 am_state_init(&state);
2441
builtin/commit-tree.c
+1 -6
@@ -37,11 +37,6 @@ static void new_parent(struct commit *parent, struct commit_list **parents_p)
37 commit_list_insert(parent, parents_p);
38 }
39
40 -static int commit_tree_config(const char *var, const char *value, void *cb)
41 -{
42 - return git_default_config(var, value, cb);
43 -}
44 -
40 static int parse_parent_arg_callback(const struct option *opt,
41 const char *arg, int unset)
42 {
@@ -118,7 +113,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
113 OPT_END()
114 };
115
121 - git_config(commit_tree_config, NULL);
116 + git_config(git_default_config, NULL);
117
118 if (argc < 2 || !strcmp(argv[1], "-h"))
119 usage_with_options(commit_tree_usage, options);
builtin/verify-commit.c
+1 -6
@@ -52,11 +52,6 @@ static int verify_commit(const char *name, unsigned flags)
52 return run_gpg_verify((struct commit *)obj, flags);
53 }
54
55 -static int git_verify_commit_config(const char *var, const char *value, void *cb)
56 -{
57 - return git_default_config(var, value, cb);
58 -}
59 -
55 int cmd_verify_commit(int argc, const char **argv, const char *prefix)
56 {
57 int i = 1, verbose = 0, had_error = 0;
@@ -67,7 +62,7 @@ int cmd_verify_commit(int argc, const char **argv, const char *prefix)
62 OPT_END()
63 };
64
70 - git_config(git_verify_commit_config, NULL);
65 + git_config(git_default_config, NULL);
66
67 argc = parse_options(argc, argv, prefix, verify_commit_options,
68 verify_commit_usage, PARSE_OPT_KEEP_ARGV0);
builtin/verify-tag.c
+1 -6
@@ -19,11 +19,6 @@ static const char * const verify_tag_usage[] = {
19 NULL
20 };
21
22 -static int git_verify_tag_config(const char *var, const char *value, void *cb)
23 -{
24 - return git_default_config(var, value, cb);
25 -}
26 -
22 int cmd_verify_tag(int argc, const char **argv, const char *prefix)
23 {
24 int i = 1, verbose = 0, had_error = 0;
@@ -36,7 +31,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
31 OPT_END()
32 };
33
39 - git_config(git_verify_tag_config, NULL);
34 + git_config(git_default_config, NULL);
35
36 argc = parse_options(argc, argv, prefix, verify_tag_options,
37 verify_tag_usage, PARSE_OPT_KEEP_ARGV0);