diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-23 16:08:32 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-23 08:15:20 -0700 |
| commit | 5d215a7b3eb0a9a69c0cb9aa43dcae956a0aa03e (patch) | |
| tree | 04c112c729836d220a6c908b3274b4e301cb5156 /builtin | |
| parent | config: drop `git_config_get_ulong()` wrapper (diff) | |
| download | git-5d215a7b3eb0a9a69c0cb9aa43dcae956a0aa03e.tar.gz git-5d215a7b3eb0a9a69c0cb9aa43dcae956a0aa03e.zip | |
config: drop `git_config_get_bool()` wrapper
In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.
Follow through with that intent and remove `git_config_get_bool()`. All
callsites are adjusted so that they use
`repo_config_get_bool(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/am.c | 8 | ||||
| -rw-r--r-- | builtin/checkout.c | 2 | ||||
| -rw-r--r-- | builtin/clone.c | 2 | ||||
| -rw-r--r-- | builtin/credential-cache--daemon.c | 2 | ||||
| -rw-r--r-- | builtin/gc.c | 6 | ||||
| -rw-r--r-- | builtin/grep.c | 2 | ||||
| -rw-r--r-- | builtin/rebase.c | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/builtin/am.c b/builtin/am.c index a7e7cf1465..6073d64ae9 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -162,18 +162,18 @@ static void am_state_init(struct am_state *state) state->prec = 4; - git_config_get_bool("am.threeway", &state->threeway); + repo_config_get_bool(the_repository, "am.threeway", &state->threeway); state->utf8 = 1; - git_config_get_bool("am.messageid", &state->message_id); + repo_config_get_bool(the_repository, "am.messageid", &state->message_id); state->scissors = SCISSORS_UNSET; state->quoted_cr = quoted_cr_unset; strvec_init(&state->git_apply_opts); - if (!git_config_get_bool("commit.gpgsign", &gpgsign)) + if (!repo_config_get_bool(the_repository, "commit.gpgsign", &gpgsign)) state->sign_commit = gpgsign ? "" : NULL; } @@ -965,7 +965,7 @@ static int split_mail(struct am_state *state, enum patch_format patch_format, { if (keep_cr < 0) { keep_cr = 0; - git_config_get_bool("am.keepcr", &keep_cr); + repo_config_get_bool(the_repository, "am.keepcr", &keep_cr); } switch (patch_format) { diff --git a/builtin/checkout.c b/builtin/checkout.c index 948ff7bdda..37efde5989 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -291,7 +291,7 @@ static int checkout_merged(int pos, const struct checkout *state, read_mmblob(&ours, &threeway[1]); read_mmblob(&theirs, &threeway[2]); - git_config_get_bool("merge.renormalize", &renormalize); + repo_config_get_bool(the_repository, "merge.renormalize", &renormalize); ll_opts.renormalize = renormalize; ll_opts.conflict_style = conflict_style; merge_status = ll_merge(&result_buf, path, &ancestor, "base", diff --git a/builtin/clone.c b/builtin/clone.c index 3c6d8529b6..34eea11db4 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -1150,7 +1150,7 @@ int cmd_clone(int argc, strbuf_reset(&sb); } - if (!git_config_get_bool("submodule.stickyRecursiveClone", &val) && + if (!repo_config_get_bool(the_repository, "submodule.stickyRecursiveClone", &val) && val) string_list_append(&option_config, "submodule.recurse=true"); diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c index 5065ff4660..65cc619bec 100644 --- a/builtin/credential-cache--daemon.c +++ b/builtin/credential-cache--daemon.c @@ -307,7 +307,7 @@ int cmd_credential_cache_daemon(int argc, OPT_END() }; - git_config_get_bool("credentialcache.ignoresighup", &ignore_sighup); + repo_config_get_bool(the_repository, "credentialcache.ignoresighup", &ignore_sighup); argc = parse_options(argc, argv, prefix, options, usage, 0); socket_path = argv[0]; diff --git a/builtin/gc.c b/builtin/gc.c index d15daf5962..fa62e4f262 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -193,8 +193,8 @@ static void gc_config(struct gc_config *cfg) repo_config_get_int(the_repository, "gc.aggressivedepth", &cfg->aggressive_depth); repo_config_get_int(the_repository, "gc.auto", &cfg->gc_auto_threshold); repo_config_get_int(the_repository, "gc.autopacklimit", &cfg->gc_auto_pack_limit); - git_config_get_bool("gc.autodetach", &cfg->detach_auto); - git_config_get_bool("gc.cruftpacks", &cfg->cruft_packs); + repo_config_get_bool(the_repository, "gc.autodetach", &cfg->detach_auto); + repo_config_get_bool(the_repository, "gc.cruftpacks", &cfg->cruft_packs); repo_config_get_ulong(the_repository, "gc.maxcruftsize", &cfg->max_cruft_size); if (!repo_config_get_expiry(the_repository, "gc.pruneexpire", &owned)) { @@ -1779,7 +1779,7 @@ static void initialize_task_config(struct maintenance_run_opts *opts, strbuf_reset(&config_name); strbuf_addf(&config_name, "maintenance.%s.enabled", tasks[i].name); - if (!git_config_get_bool(config_name.buf, &config_value)) + if (!repo_config_get_bool(the_repository, config_name.buf, &config_value)) strategy.tasks[i].enabled = config_value; if (!strategy.tasks[i].enabled) continue; diff --git a/builtin/grep.c b/builtin/grep.c index 7982dda9a3..8fcb69dbf2 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1058,7 +1058,7 @@ int cmd_grep(int argc, if (use_index && !startup_info->have_repository) { int fallback = 0; - git_config_get_bool("grep.fallbacktonoindex", &fallback); + repo_config_get_bool(the_repository, "grep.fallbacktonoindex", &fallback); if (fallback) use_index = 0; else diff --git a/builtin/rebase.c b/builtin/rebase.c index 0c3daa4b81..72a52bdfb9 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -340,7 +340,7 @@ static int run_sequencer_rebase(struct rebase_options *opts) unsigned flags = 0; int abbreviate_commands = 0, ret = 0; - git_config_get_bool("rebase.abbreviatecommands", &abbreviate_commands); + repo_config_get_bool(the_repository, "rebase.abbreviatecommands", &abbreviate_commands); flags |= opts->keep_empty ? TODO_LIST_KEEP_EMPTY : 0; flags |= abbreviate_commands ? TODO_LIST_ABBREVIATE_CMDS : 0; |
