summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c1
-rw-r--r--builtin/am.c10
-rw-r--r--builtin/blame.c2
-rw-r--r--builtin/branch.c8
-rw-r--r--builtin/cat-file.c2
-rw-r--r--builtin/check-attr.c2
-rw-r--r--builtin/check-ignore.c3
-rw-r--r--builtin/check-mailmap.c3
-rw-r--r--builtin/checkout--worker.c3
-rw-r--r--builtin/checkout-index.c1
-rw-r--r--builtin/checkout.c4
-rw-r--r--builtin/clean.c3
-rw-r--r--builtin/clone.c26
-rw-r--r--builtin/column.c4
-rw-r--r--builtin/commit-graph.c5
-rw-r--r--builtin/commit-tree.c3
-rw-r--r--builtin/commit.c4
-rw-r--r--builtin/config.c60
-rw-r--r--builtin/count-objects.c3
-rw-r--r--builtin/credential-cache--daemon.c2
-rw-r--r--builtin/credential-store.c2
-rw-r--r--builtin/credential.c3
-rw-r--r--builtin/describe.c2
-rw-r--r--builtin/diff-files.c2
-rw-r--r--builtin/diff-index.c2
-rw-r--r--builtin/diff-tree.c2
-rw-r--r--builtin/diff.c2
-rw-r--r--builtin/fast-export.c3
-rw-r--r--builtin/fast-import.c12
-rw-r--r--builtin/fetch.c10
-rw-r--r--builtin/fmt-merge-msg.c2
-rw-r--r--builtin/for-each-ref.c1
-rw-r--r--builtin/fsck.c2
-rw-r--r--builtin/fsmonitor--daemon.c3
-rw-r--r--builtin/gc.c70
-rw-r--r--builtin/grep.c5
-rw-r--r--builtin/hash-object.c3
-rw-r--r--builtin/help.c5
-rw-r--r--builtin/hook.c3
-rw-r--r--builtin/index-pack.c2
-rw-r--r--builtin/interpret-trailers.c3
-rw-r--r--builtin/log.c24
-rw-r--r--builtin/ls-files.c1
-rw-r--r--builtin/ls-tree.c3
-rw-r--r--builtin/merge-base.c3
-rw-r--r--builtin/merge-file.c2
-rw-r--r--builtin/merge-tree.c3
-rw-r--r--builtin/merge.c2
-rw-r--r--builtin/mktag.c2
-rw-r--r--builtin/multi-pack-index.c5
-rw-r--r--builtin/mv.c2
-rw-r--r--builtin/name-rev.c2
-rw-r--r--builtin/notes.c4
-rw-r--r--builtin/pack-objects.c2
-rw-r--r--builtin/pack-refs.c1
-rw-r--r--builtin/patch-id.c3
-rw-r--r--builtin/pull.c9
-rw-r--r--builtin/push.c2
-rw-r--r--builtin/range-diff.c2
-rw-r--r--builtin/read-tree.c3
-rw-r--r--builtin/rebase.c4
-rw-r--r--builtin/receive-pack.c2
-rw-r--r--builtin/reflog.c2
-rw-r--r--builtin/refs.c2
-rw-r--r--builtin/remote.c56
-rw-r--r--builtin/repack.c2
-rw-r--r--builtin/replace.c3
-rw-r--r--builtin/rerere.c2
-rw-r--r--builtin/reset.c2
-rw-r--r--builtin/rev-list.c2
-rw-r--r--builtin/rev-parse.c4
-rw-r--r--builtin/rm.c3
-rw-r--r--builtin/send-pack.c1
-rw-r--r--builtin/shortlog.c2
-rw-r--r--builtin/show-branch.c2
-rw-r--r--builtin/show-ref.c3
-rw-r--r--builtin/sparse-checkout.c2
-rw-r--r--builtin/stash.c4
-rw-r--r--builtin/stripspace.c2
-rw-r--r--builtin/submodule--helper.c56
-rw-r--r--builtin/symbolic-ref.c3
-rw-r--r--builtin/tag.c2
-rw-r--r--builtin/unpack-file.c3
-rw-r--r--builtin/unpack-objects.c2
-rw-r--r--builtin/update-index.c2
-rw-r--r--builtin/update-ref.c3
-rw-r--r--builtin/update-server-info.c1
-rw-r--r--builtin/var.c5
-rw-r--r--builtin/verify-commit.c1
-rw-r--r--builtin/verify-pack.c3
-rw-r--r--builtin/verify-tag.c1
-rw-r--r--builtin/worktree.c8
-rw-r--r--builtin/write-tree.c3
93 files changed, 298 insertions, 258 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 7c292ffdc6..88d1d330fa 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -7,6 +7,7 @@
#include "builtin.h"
#include "advice.h"
#include "config.h"
+#include "environment.h"
#include "lockfile.h"
#include "editor.h"
#include "dir.h"
diff --git a/builtin/am.c b/builtin/am.c
index c9d925f7b9..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) {
@@ -2445,7 +2445,7 @@ int cmd_am(int argc,
show_usage_with_options_if_asked(argc, argv, usage, options);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
am_state_init(&state);
diff --git a/builtin/blame.c b/builtin/blame.c
index dc934abef4..5b10e84b66 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -940,7 +940,7 @@ int cmd_blame(int argc,
const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
setup_default_color_by_age();
- git_config(git_blame_config, &output_option);
+ repo_config(the_repository, git_blame_config, &output_option);
repo_init_revisions(the_repository, &revs, NULL);
revs.date_mode = blame_date_mode;
revs.diffopt.flags.allow_textconv = 1;
diff --git a/builtin/branch.c b/builtin/branch.c
index c150131bd9..fa5ced452e 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -699,7 +699,7 @@ static int edit_branch_description(const char *branch_name)
strbuf_addf(&name, "branch.%s.description", branch_name);
if (buf.len || exists)
- git_config_set(name.buf, buf.len ? buf.buf : NULL);
+ repo_config_set(the_repository, name.buf, buf.len ? buf.buf : NULL);
strbuf_release(&name);
strbuf_release(&buf);
@@ -791,7 +791,7 @@ int cmd_branch(int argc,
* Try to set sort keys from config. If config does not set any,
* fall back on default (refname) sorting.
*/
- git_config(git_branch_config, &sorting_options);
+ repo_config(the_repository, git_branch_config, &sorting_options);
if (!sorting_options.nr)
string_list_append(&sorting_options, "refname");
@@ -987,10 +987,10 @@ int cmd_branch(int argc,
strbuf_reset(&buf);
strbuf_addf(&buf, "branch.%s.remote", branch->name);
- git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
+ repo_config_set_multivar(the_repository, buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
strbuf_reset(&buf);
strbuf_addf(&buf, "branch.%s.merge", branch->name);
- git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
+ repo_config_set_multivar(the_repository, buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
strbuf_release(&buf);
} else if (!noncreate_actions && argc > 0 && argc <= 2) {
const char *branch_name = argv[0];
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 2492a0b6f3..b9eb2bb3b9 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -1095,7 +1095,7 @@ int cmd_cat_file(int argc,
OPT_END()
};
- git_config(git_cat_file_config, NULL);
+ repo_config(the_repository, git_cat_file_config, NULL);
batch.buffer_output = -1;
diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index 7cf275b893..51ed48ce43 100644
--- a/builtin/check-attr.c
+++ b/builtin/check-attr.c
@@ -119,7 +119,7 @@ int cmd_check_attr(int argc,
if (!is_bare_repository())
setup_work_tree();
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, check_attr_options,
check_attr_usage, PARSE_OPT_KEEP_DASHDASH);
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c
index 7b7831d13a..644c9a414f 100644
--- a/builtin/check-ignore.c
+++ b/builtin/check-ignore.c
@@ -2,6 +2,7 @@
#include "builtin.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
#include "gettext.h"
#include "quote.h"
#include "pathspec.h"
@@ -159,7 +160,7 @@ int cmd_check_ignore(int argc,
int num_ignored;
struct dir_struct dir = DIR_INIT;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, check_ignore_options,
check_ignore_usage, 0);
diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c
index be2cebe121..9cc5c59830 100644
--- a/builtin/check-mailmap.c
+++ b/builtin/check-mailmap.c
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "ident.h"
#include "mailmap.h"
@@ -56,7 +57,7 @@ int cmd_check_mailmap(int argc,
int i;
struct string_list mailmap = STRING_LIST_INIT_NODUP;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, check_mailmap_options,
check_mailmap_usage, 0);
if (argc == 0 && !use_stdin)
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index da9345a44b..e0772b718b 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -4,6 +4,7 @@
#include "builtin.h"
#include "config.h"
#include "entry.h"
+#include "environment.h"
#include "gettext.h"
#include "parallel-checkout.h"
#include "parse-options.h"
@@ -132,7 +133,7 @@ int cmd_checkout__worker(int argc,
checkout_worker_usage,
checkout_worker_options);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, checkout_worker_options,
checkout_worker_usage, 0);
if (argc > 0)
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index 7f74bc702f..188128aebd 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -9,6 +9,7 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "lockfile.h"
#include "quote.h"
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 0a90b86a72..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",
@@ -1764,7 +1764,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
opts->prefix = prefix;
opts->show_progress = -1;
- git_config(git_checkout_config, opts);
+ repo_config(the_repository, git_checkout_config, opts);
if (the_repository->gitdir) {
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/clean.c b/builtin/clean.c
index 053c94fc6b..a1977b92dc 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -13,6 +13,7 @@
#include "abspath.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
#include "path.h"
@@ -949,7 +950,7 @@ int cmd_clean(int argc,
OPT_END()
};
- git_config(git_clean_config, NULL);
+ repo_config(the_repository, git_clean_config, NULL);
argc = parse_options(argc, argv, prefix, options, builtin_clean_usage,
0);
diff --git a/builtin/clone.c b/builtin/clone.c
index 6d08abed37..c990f398ef 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -762,16 +762,16 @@ static int write_one_config(const char *key, const char *value,
{
/*
* give git_clone_config a chance to write config values back to the
- * environment, since git_config_set_multivar_gently only deals with
+ * environment, since repo_config_set_multivar_gently only deals with
* config-file writes
*/
int apply_failed = git_clone_config(key, value, ctx, data);
if (apply_failed)
return apply_failed;
- return git_config_set_multivar_gently(key,
- value ? value : "true",
- CONFIG_REGEX_NONE, 0);
+ return repo_config_set_multivar_gently(the_repository, key,
+ value ? value : "true",
+ CONFIG_REGEX_NONE, 0);
}
static void write_config(struct string_list *config)
@@ -822,12 +822,12 @@ static void write_refspec_config(const char *src_ref_prefix,
/* Configure the remote */
if (value.len) {
strbuf_addf(&key, "remote.%s.fetch", remote_name);
- git_config_set_multivar(key.buf, value.buf, "^$", 0);
+ repo_config_set_multivar(the_repository, key.buf, value.buf, "^$", 0);
strbuf_reset(&key);
if (option_mirror) {
strbuf_addf(&key, "remote.%s.mirror", remote_name);
- git_config_set(key.buf, "true");
+ repo_config_set(the_repository, key.buf, "true");
strbuf_reset(&key);
}
}
@@ -1001,7 +1001,7 @@ int cmd_clone(int argc,
packet_trace_identity("clone");
- git_config(git_clone_config, NULL);
+ repo_config(the_repository, git_clone_config, NULL);
argc = parse_options(argc, argv, prefix, builtin_clone_options,
builtin_clone_usage, 0);
@@ -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");
@@ -1242,7 +1242,7 @@ int cmd_clone(int argc,
* re-read config after init_db and write_config to pick up any config
* injected by --template and --config, respectively.
*/
- git_config(git_clone_config, NULL);
+ repo_config(the_repository, git_clone_config, NULL);
/*
* If option_reject_shallow is specified from CLI option,
@@ -1294,18 +1294,18 @@ int cmd_clone(int argc,
src_ref_prefix = "refs/";
strbuf_addstr(&branch_top, src_ref_prefix);
- git_config_set("core.bare", "true");
+ repo_config_set(the_repository, "core.bare", "true");
} else if (!option_rev) {
strbuf_addf(&branch_top, "refs/remotes/%s/", remote_name);
}
strbuf_addf(&key, "remote.%s.url", remote_name);
- git_config_set(key.buf, repo);
+ repo_config_set(the_repository, key.buf, repo);
strbuf_reset(&key);
if (!option_tags) {
strbuf_addf(&key, "remote.%s.tagOpt", remote_name);
- git_config_set(key.buf, "--no-tags");
+ repo_config_set(the_repository, key.buf, "--no-tags");
strbuf_reset(&key);
}
@@ -1467,7 +1467,7 @@ int cmd_clone(int argc,
warning(_("failed to fetch objects from bundle URI '%s'"),
bundle_uri);
else if (has_heuristic)
- git_config_set_gently("fetch.bundleuri", bundle_uri);
+ repo_config_set_gently(the_repository, "fetch.bundleuri", bundle_uri);
remote_state_clear(the_repository->remote_state);
free(the_repository->remote_state);
diff --git a/builtin/column.c b/builtin/column.c
index ce6443d5fa..87dce3c6e5 100644
--- a/builtin/column.c
+++ b/builtin/column.c
@@ -42,9 +42,9 @@ int cmd_column(int argc,
/* This one is special and must be the first one */
if (argc > 1 && starts_with(argv[1], "--command=")) {
command = argv[1] + 10;
- git_config(column_config, (void *)command);
+ repo_config(the_repository, column_config, (void *)command);
} else
- git_config(column_config, NULL);
+ repo_config(the_repository, column_config, NULL);
memset(&copts, 0, sizeof(copts));
copts.padding = 1;
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 25018a0b9d..4992ac146e 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -2,6 +2,7 @@
#include "builtin.h"
#include "commit.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
@@ -265,7 +266,7 @@ static int graph_write(int argc, const char **argv, const char *prefix,
trace2_cmd_mode("write");
- git_config(git_commit_graph_write_config, &opts);
+ repo_config(the_repository, git_commit_graph_write_config, &opts);
argc = parse_options(argc, argv, prefix,
options,
@@ -347,7 +348,7 @@ int cmd_commit_graph(int argc,
};
struct option *options = parse_options_concat(builtin_commit_graph_options, common_opts);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
disable_replace_refs();
save_commit_buffer = 0;
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 31cfd9bd15..5189e685a7 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -6,6 +6,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "object-name.h"
@@ -125,7 +126,7 @@ int cmd_commit_tree(int argc,
};
int ret;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
show_usage_with_options_if_asked(argc, argv,
commit_tree_usage, options);
diff --git a/builtin/commit.c b/builtin/commit.c
index 63e7158e98..757f51eac8 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -207,9 +207,9 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)
{
wt_status_prepare(the_repository, s);
init_diff_ui_defaults();
- git_config(fn, s);
+ repo_config(the_repository, fn, s);
determine_whence(s);
- s->hints = advice_enabled(ADVICE_STATUS_HINTS); /* must come after git_config() */
+ s->hints = advice_enabled(ADVICE_STATUS_HINTS); /* must come after repo_config() */
}
static void rollback_index_files(void)
diff --git a/builtin/config.c b/builtin/config.c
index 5efe273010..59fb113b07 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -966,12 +966,12 @@ static int cmd_config_set(int argc, const char **argv, const char *prefix,
value = normalize_value(argv[0], argv[1], type, &default_kvi);
if ((flags & CONFIG_FLAGS_MULTI_REPLACE) || value_pattern) {
- ret = git_config_set_multivar_in_file_gently(location_opts.source.file,
- argv[0], value, value_pattern,
- comment, flags);
+ ret = repo_config_set_multivar_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], value, value_pattern,
+ comment, flags);
} else {
- ret = git_config_set_in_file_gently(location_opts.source.file,
- argv[0], comment, value);
+ ret = repo_config_set_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], comment, value);
if (ret == CONFIG_NOTHING_SET)
error(_("cannot overwrite multiple values with a single value\n"
" Use a regexp, --add or --replace-all to change %s."), argv[0]);
@@ -1010,12 +1010,12 @@ static int cmd_config_unset(int argc, const char **argv, const char *prefix,
check_write(&location_opts.source);
if ((flags & CONFIG_FLAGS_MULTI_REPLACE) || value_pattern)
- ret = git_config_set_multivar_in_file_gently(location_opts.source.file,
- argv[0], NULL, value_pattern,
- NULL, flags);
+ ret = repo_config_set_multivar_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], NULL, value_pattern,
+ NULL, flags);
else
- ret = git_config_set_in_file_gently(location_opts.source.file, argv[0],
- NULL, NULL);
+ ret = repo_config_set_in_file_gently(the_repository, location_opts.source.file, argv[0],
+ NULL, NULL);
location_options_release(&location_opts);
return ret;
@@ -1091,7 +1091,7 @@ static int show_editor(struct config_location_options *opts)
die(_("editing stdin is not supported"));
if (opts->source.blob)
die(_("editing blobs is not supported"));
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
config_file = opts->source.file ?
xstrdup(opts->source.file) :
repo_git_path(the_repository, "config");
@@ -1296,7 +1296,7 @@ static int cmd_config_actions(int argc, const char **argv, const char *prefix)
check_write(&location_opts.source);
check_argc(argc, 2, 2);
value = normalize_value(argv[0], argv[1], display_opts.type, &default_kvi);
- ret = git_config_set_in_file_gently(location_opts.source.file, argv[0], comment, value);
+ ret = repo_config_set_in_file_gently(the_repository, location_opts.source.file, argv[0], comment, value);
if (ret == CONFIG_NOTHING_SET)
error(_("cannot overwrite multiple values with a single value\n"
" Use a regexp, --add or --replace-all to change %s."), argv[0]);
@@ -1305,26 +1305,26 @@ static int cmd_config_actions(int argc, const char **argv, const char *prefix)
check_write(&location_opts.source);
check_argc(argc, 2, 3);
value = normalize_value(argv[0], argv[1], display_opts.type, &default_kvi);
- ret = git_config_set_multivar_in_file_gently(location_opts.source.file,
- argv[0], value, argv[2],
- comment, flags);
+ ret = repo_config_set_multivar_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], value, argv[2],
+ comment, flags);
}
else if (actions == ACTION_ADD) {
check_write(&location_opts.source);
check_argc(argc, 2, 2);
value = normalize_value(argv[0], argv[1], display_opts.type, &default_kvi);
- ret = git_config_set_multivar_in_file_gently(location_opts.source.file,
- argv[0], value,
- CONFIG_REGEX_NONE,
- comment, flags);
+ ret = repo_config_set_multivar_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], value,
+ CONFIG_REGEX_NONE,
+ comment, flags);
}
else if (actions == ACTION_REPLACE_ALL) {
check_write(&location_opts.source);
check_argc(argc, 2, 3);
value = normalize_value(argv[0], argv[1], display_opts.type, &default_kvi);
- ret = git_config_set_multivar_in_file_gently(location_opts.source.file,
- argv[0], value, argv[2],
- comment, flags | CONFIG_FLAGS_MULTI_REPLACE);
+ ret = repo_config_set_multivar_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], value, argv[2],
+ comment, flags | CONFIG_FLAGS_MULTI_REPLACE);
}
else if (actions == ACTION_GET) {
check_argc(argc, 1, 2);
@@ -1350,19 +1350,19 @@ static int cmd_config_actions(int argc, const char **argv, const char *prefix)
check_write(&location_opts.source);
check_argc(argc, 1, 2);
if (argc == 2)
- ret = git_config_set_multivar_in_file_gently(location_opts.source.file,
- argv[0], NULL, argv[1],
- NULL, flags);
+ ret = repo_config_set_multivar_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], NULL, argv[1],
+ NULL, flags);
else
- ret = git_config_set_in_file_gently(location_opts.source.file,
- argv[0], NULL, NULL);
+ ret = repo_config_set_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], NULL, NULL);
}
else if (actions == ACTION_UNSET_ALL) {
check_write(&location_opts.source);
check_argc(argc, 1, 2);
- ret = git_config_set_multivar_in_file_gently(location_opts.source.file,
- argv[0], NULL, argv[1],
- NULL, flags | CONFIG_FLAGS_MULTI_REPLACE);
+ ret = repo_config_set_multivar_in_file_gently(the_repository, location_opts.source.file,
+ argv[0], NULL, argv[1],
+ NULL, flags | CONFIG_FLAGS_MULTI_REPLACE);
}
else if (actions == ACTION_RENAME_SECTION) {
check_write(&location_opts.source);
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index f687647931..b1148a68fa 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -7,6 +7,7 @@
#include "builtin.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
#include "gettext.h"
#include "path.h"
#include "parse-options.h"
@@ -106,7 +107,7 @@ int cmd_count_objects(int argc,
OPT_END(),
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, opts, count_objects_usage, 0);
/* we do not take arguments other than flags for now */
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/credential-store.c b/builtin/credential-store.c
index e669e99dbf..b74e06cc93 100644
--- a/builtin/credential-store.c
+++ b/builtin/credential-store.c
@@ -66,7 +66,7 @@ static void rewrite_credential_file(const char *fn, struct credential *c,
{
int timeout_ms = 1000;
- git_config_get_int("credentialstore.locktimeoutms", &timeout_ms);
+ repo_config_get_int(the_repository, "credentialstore.locktimeoutms", &timeout_ms);
if (hold_lock_file_for_update_timeout(&credential_lock, fn, 0, timeout_ms) < 0)
die_errno(_("unable to get credential storage lock in %d ms"), timeout_ms);
if (extra)
diff --git a/builtin/credential.c b/builtin/credential.c
index 2e11b15dde..a295c80b36 100644
--- a/builtin/credential.c
+++ b/builtin/credential.c
@@ -3,6 +3,7 @@
#include "git-compat-util.h"
#include "credential.h"
#include "builtin.h"
+#include "environment.h"
#include "config.h"
static const char usage_msg[] =
@@ -16,7 +17,7 @@ int cmd_credential(int argc,
const char *op;
struct credential c = CREDENTIAL_INIT;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
show_usage_if_asked(argc, argv, usage_msg);
if (argc != 2)
diff --git a/builtin/describe.c b/builtin/describe.c
index fbf305d762..d7dd8139de 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -623,7 +623,7 @@ int cmd_describe(int argc,
OPT_END(),
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, describe_usage, 0);
if (abbrev < 0)
abbrev = DEFAULT_ABBREV;
diff --git a/builtin/diff-files.c b/builtin/diff-files.c
index 99b1749723..ea91347ce2 100644
--- a/builtin/diff-files.c
+++ b/builtin/diff-files.c
@@ -31,7 +31,7 @@ int cmd_diff_files(int argc,
show_usage_if_asked(argc, argv, diff_files_usage);
- git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+ repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index 81c0bc8ed7..522dacfc4c 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -28,7 +28,7 @@ int cmd_diff_index(int argc,
show_usage_if_asked(argc, argv, diff_cache_usage);
- git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+ repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index e31cc797fe..49dd4d00eb 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -124,7 +124,7 @@ int cmd_diff_tree(int argc,
show_usage_if_asked(argc, argv, diff_tree_usage);
- git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+ repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/diff.c b/builtin/diff.c
index eebffe36cc..9a89e25a98 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -486,7 +486,7 @@ int cmd_diff(int argc,
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
init_diff_ui_defaults();
- git_config(git_diff_ui_config, NULL);
+ repo_config(the_repository, git_diff_ui_config, NULL);
prefix = precompose_argv_prefix(argc, argv, prefix);
repo_init_revisions(the_repository, &rev, prefix);
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index f4169dc5f3..c06ee0b213 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -9,6 +9,7 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "refs.h"
@@ -1361,7 +1362,7 @@ int cmd_fast_export(int argc,
usage_with_options (fast_export_usage, options);
/* we handle encodings */
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
repo_init_revisions(the_repository, &revs, prefix);
init_revision_sources(&revision_sources);
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 6e7d0c3449..adf3994be1 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -3592,25 +3592,25 @@ static void git_pack_config(void)
int limit;
unsigned long packsizelimit_value;
- if (!git_config_get_ulong("pack.depth", &max_depth)) {
+ if (!repo_config_get_ulong(the_repository, "pack.depth", &max_depth)) {
if (max_depth > MAX_DEPTH)
max_depth = MAX_DEPTH;
}
- if (!git_config_get_int("pack.indexversion", &indexversion_value)) {
+ if (!repo_config_get_int(the_repository, "pack.indexversion", &indexversion_value)) {
pack_idx_opts.version = indexversion_value;
if (pack_idx_opts.version > 2)
git_die_config(the_repository, "pack.indexversion",
"bad pack.indexVersion=%"PRIu32, pack_idx_opts.version);
}
- if (!git_config_get_ulong("pack.packsizelimit", &packsizelimit_value))
+ if (!repo_config_get_ulong(the_repository, "pack.packsizelimit", &packsizelimit_value))
max_packsize = packsizelimit_value;
- if (!git_config_get_int("fastimport.unpacklimit", &limit))
+ if (!repo_config_get_int(the_repository, "fastimport.unpacklimit", &limit))
unpack_limit = limit;
- else if (!git_config_get_int("transfer.unpacklimit", &limit))
+ else if (!repo_config_get_int(the_repository, "transfer.unpacklimit", &limit))
unpack_limit = limit;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
}
static const char fast_import_usage[] =
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 87a0cca799..24645c4653 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1995,7 +1995,7 @@ static int add_remote_or_group(const char *name, struct string_list *list)
struct remote_group_data g;
g.name = name; g.list = list;
- git_config(get_remote_group, &g);
+ repo_config(the_repository, get_remote_group, &g);
if (list->nr == prev_nr) {
struct remote *remote = remote_get(name);
if (!remote_is_configured(remote, 0))
@@ -2417,7 +2417,7 @@ int cmd_fetch(int argc,
free(anon);
}
- git_config(git_fetch_config, &config);
+ repo_config(the_repository, git_fetch_config, &config);
if (the_repository->gitdir) {
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
@@ -2508,7 +2508,7 @@ int cmd_fetch(int argc,
if (!max_jobs)
max_jobs = online_cpus();
- if (!git_config_get_string_tmp("fetch.bundleuri", &bundle_uri) &&
+ if (!repo_config_get_string_tmp(the_repository, "fetch.bundleuri", &bundle_uri) &&
fetch_bundle_uri(the_repository, bundle_uri, NULL))
warning(_("failed to fetch bundles from '%s'"), bundle_uri);
@@ -2683,12 +2683,12 @@ int cmd_fetch(int argc,
* but respect config settings disabling it.
*/
int opt_val;
- if (git_config_get_int("gc.autopacklimit", &opt_val))
+ if (repo_config_get_int(the_repository, "gc.autopacklimit", &opt_val))
opt_val = -1;
if (opt_val != 0)
git_config_push_parameter("gc.autoPackLimit=1");
- if (git_config_get_int("maintenance.incremental-repack.auto", &opt_val))
+ if (repo_config_get_int(the_repository, "maintenance.incremental-repack.auto", &opt_val))
opt_val = -1;
if (opt_val != 0)
git_config_push_parameter("maintenance.incremental-repack.auto=-1");
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 3b6aac2cf7..edb93c0b3a 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -53,7 +53,7 @@ int cmd_fmt_merge_msg(int argc,
int ret;
struct fmt_merge_msg_opts opts;
- git_config(fmt_merge_msg_config, NULL);
+ repo_config(the_repository, fmt_merge_msg_config, NULL);
argc = parse_options(argc, argv, prefix, options, fmt_merge_msg_usage,
0);
if (argc > 0)
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 79a79212c9..8b5fe7b65e 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "commit.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "object.h"
#include "parse-options.h"
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 0084cf7400..0ec6ca06e3 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -987,7 +987,7 @@ int cmd_fsck(int argc,
if (name_objects)
fsck_enable_object_names(&fsck_walk_options);
- git_config(git_fsck_config, &fsck_obj_options);
+ repo_config(the_repository, git_fsck_config, &fsck_obj_options);
prepare_repo_settings(the_repository);
if (check_references)
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index 0820e524f1..242c594646 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -5,6 +5,7 @@
#include "abspath.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
#include "fsmonitor-ll.h"
@@ -1547,7 +1548,7 @@ int cmd_fsmonitor__daemon(int argc,
OPT_END()
};
- git_config(fsmonitor_config, NULL);
+ repo_config(the_repository, fsmonitor_config, NULL);
argc = parse_options(argc, argv, prefix, options,
builtin_fsmonitor__daemon_usage, 0);
diff --git a/builtin/gc.c b/builtin/gc.c
index a02d6b7806..6fd4dc26be 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -114,7 +114,7 @@ static int gc_config_is_timestamp_never(const char *var)
const char *value;
timestamp_t expire;
- if (!git_config_get_value(var, &value) && value) {
+ if (!repo_config_get_value(the_repository, var, &value) && value) {
if (parse_expiry_date(value, &expire))
die(_("failed to parse '%s' value '%s'"), var, value);
return expire == 0;
@@ -178,7 +178,7 @@ static void gc_config(struct gc_config *cfg)
char *owned = NULL;
unsigned long ulongval;
- if (!git_config_get_value("gc.packrefs", &value)) {
+ if (!repo_config_get_value(the_repository, "gc.packrefs", &value)) {
if (value && !strcmp(value, "notbare"))
cfg->pack_refs = -1;
else
@@ -189,13 +189,13 @@ static void gc_config(struct gc_config *cfg)
gc_config_is_timestamp_never("gc.reflogexpireunreachable"))
cfg->prune_reflogs = 0;
- git_config_get_int("gc.aggressivewindow", &cfg->aggressive_window);
- git_config_get_int("gc.aggressivedepth", &cfg->aggressive_depth);
- git_config_get_int("gc.auto", &cfg->gc_auto_threshold);
- git_config_get_int("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);
- git_config_get_ulong("gc.maxcruftsize", &cfg->max_cruft_size);
+ repo_config_get_int(the_repository, "gc.aggressivewindow", &cfg->aggressive_window);
+ 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);
+ 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)) {
free(cfg->prune_expire);
@@ -212,23 +212,23 @@ static void gc_config(struct gc_config *cfg)
cfg->gc_log_expire = owned;
}
- git_config_get_ulong("gc.bigpackthreshold", &cfg->big_pack_threshold);
- git_config_get_ulong("pack.deltacachesize", &cfg->max_delta_cache_size);
+ repo_config_get_ulong(the_repository, "gc.bigpackthreshold", &cfg->big_pack_threshold);
+ repo_config_get_ulong(the_repository, "pack.deltacachesize", &cfg->max_delta_cache_size);
- if (!git_config_get_ulong("core.deltabasecachelimit", &ulongval))
+ if (!repo_config_get_ulong(the_repository, "core.deltabasecachelimit", &ulongval))
cfg->delta_base_cache_limit = ulongval;
- if (!git_config_get_string("gc.repackfilter", &owned)) {
+ if (!repo_config_get_string(the_repository, "gc.repackfilter", &owned)) {
free(cfg->repack_filter);
cfg->repack_filter = owned;
}
- if (!git_config_get_string("gc.repackfilterto", &owned)) {
+ if (!repo_config_get_string(the_repository, "gc.repackfilterto", &owned)) {
free(cfg->repack_filter_to);
cfg->repack_filter_to = owned;
}
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
}
enum schedule_priority {
@@ -332,7 +332,7 @@ static int reflog_expire_condition(struct gc_config *cfg UNUSED)
};
int limit = 100;
- git_config_get_int("maintenance.reflog-expire.auto", &limit);
+ repo_config_get_int(the_repository, "maintenance.reflog-expire.auto", &limit);
if (!limit)
return 0;
if (limit < 0)
@@ -379,7 +379,7 @@ static int worktree_prune_condition(struct gc_config *cfg)
struct dirent *d;
DIR *dir = NULL;
- git_config_get_int("maintenance.worktree-prune.auto", &limit);
+ repo_config_get_int(the_repository, "maintenance.worktree-prune.auto", &limit);
if (limit <= 0) {
should_prune = limit < 0;
goto out;
@@ -424,7 +424,7 @@ static int rerere_gc_condition(struct gc_config *cfg UNUSED)
int should_gc = 0, limit = 1;
DIR *dir = NULL;
- git_config_get_int("maintenance.rerere-gc.auto", &limit);
+ repo_config_get_int(the_repository, "maintenance.rerere-gc.auto", &limit);
if (limit <= 0) {
should_gc = limit < 0;
goto out;
@@ -1162,8 +1162,8 @@ static int should_write_commit_graph(struct gc_config *cfg UNUSED)
data.num_not_in_graph = 0;
data.limit = 100;
- git_config_get_int("maintenance.commit-graph.auto",
- &data.limit);
+ repo_config_get_int(the_repository, "maintenance.commit-graph.auto",
+ &data.limit);
if (!data.limit)
return 0;
@@ -1301,8 +1301,8 @@ static int loose_object_auto_condition(struct gc_config *cfg UNUSED)
{
int count = 0;
- git_config_get_int("maintenance.loose-objects.auto",
- &loose_object_auto_limit);
+ repo_config_get_int(the_repository, "maintenance.loose-objects.auto",
+ &loose_object_auto_limit);
if (!loose_object_auto_limit)
return 0;
@@ -1416,8 +1416,8 @@ static int incremental_repack_auto_condition(struct gc_config *cfg UNUSED)
if (!the_repository->settings.core_multi_pack_index)
return 0;
- git_config_get_int("maintenance.incremental-repack.auto",
- &incremental_repack_auto_limit);
+ repo_config_get_int(the_repository, "maintenance.incremental-repack.auto",
+ &incremental_repack_auto_limit);
if (!incremental_repack_auto_limit)
return 0;
@@ -1766,7 +1766,7 @@ static void initialize_task_config(struct maintenance_run_opts *opts,
if (opts->schedule) {
strategy = none_strategy;
- if (!git_config_get_string_tmp("maintenance.strategy", &config_str)) {
+ if (!repo_config_get_string_tmp(the_repository, "maintenance.strategy", &config_str)) {
if (!strcasecmp(config_str, "incremental"))
strategy = incremental_strategy;
}
@@ -1780,7 +1780,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;
@@ -1789,7 +1789,7 @@ static void initialize_task_config(struct maintenance_run_opts *opts,
strbuf_reset(&config_name);
strbuf_addf(&config_name, "maintenance.%s.schedule",
tasks[i].name);
- if (!git_config_get_string_tmp(config_name.buf, &config_str))
+ if (!repo_config_get_string_tmp(the_repository, config_name.buf, &config_str))
strategy.tasks[i].schedule = parse_schedule(config_str);
if (strategy.tasks[i].schedule < opts->schedule)
continue;
@@ -1914,13 +1914,13 @@ static int maintenance_register(int argc, const char **argv, const char *prefix,
options);
/* Disable foreground maintenance */
- git_config_set("maintenance.auto", "false");
+ repo_config_set(the_repository, "maintenance.auto", "false");
/* Set maintenance strategy, if unset */
- if (git_config_get("maintenance.strategy"))
- git_config_set("maintenance.strategy", "incremental");
+ if (repo_config_get(the_repository, "maintenance.strategy"))
+ repo_config_set(the_repository, "maintenance.strategy", "incremental");
- if (!git_config_get_string_multi(key, &list)) {
+ if (!repo_config_get_string_multi(the_repository, key, &list)) {
for_each_string_list_item(item, list) {
if (!strcmp(maintpath, item->string)) {
found = 1;
@@ -1939,7 +1939,7 @@ static int maintenance_register(int argc, const char **argv, const char *prefix,
}
if (!config_file)
die(_("$HOME not set"));
- rc = git_config_set_multivar_in_file_gently(
+ rc = repo_config_set_multivar_in_file_gently(the_repository,
config_file, "maintenance.repo", maintpath,
CONFIG_REGEX_NONE, NULL, 0);
free(global_config_file);
@@ -1989,7 +1989,7 @@ static int maintenance_unregister(int argc, const char **argv, const char *prefi
}
if (!(config_file
? git_configset_get_string_multi(&cs, key, &list)
- : git_config_get_string_multi(key, &list))) {
+ : repo_config_get_string_multi(the_repository, key, &list))) {
for_each_string_list_item(item, list) {
if (!strcmp(maintpath, item->string)) {
found = 1;
@@ -2008,7 +2008,7 @@ static int maintenance_unregister(int argc, const char **argv, const char *prefi
}
if (!config_file)
die(_("$HOME not set"));
- rc = git_config_set_multivar_in_file_gently(
+ rc = repo_config_set_multivar_in_file_gently(the_repository,
config_file, key, NULL, maintpath, NULL,
CONFIG_FLAGS_MULTI_REPLACE | CONFIG_FLAGS_FIXED_VALUE);
free(global_config_file);
@@ -2345,7 +2345,7 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit
die(_("failed to create directories for '%s'"), filename);
if ((long)lock_file_timeout_ms < 0 &&
- git_config_get_ulong("gc.launchctlplistlocktimeoutms",
+ repo_config_get_ulong(the_repository, "gc.launchctlplistlocktimeoutms",
&lock_file_timeout_ms))
lock_file_timeout_ms = 150;
diff --git a/builtin/grep.c b/builtin/grep.c
index 39273d9c0f..5df6537333 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -9,6 +9,7 @@
#include "builtin.h"
#include "abspath.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "config.h"
@@ -1035,7 +1036,7 @@ int cmd_grep(int argc,
grep_prefix = prefix;
grep_init(&opt, the_repository);
- git_config(grep_cmd_config, &opt);
+ repo_config(the_repository, grep_cmd_config, &opt);
/*
* If there is no -- then the paths must exist in the working
@@ -1058,7 +1059,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/hash-object.c b/builtin/hash-object.c
index ddf281413a..5d900a6b8c 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -8,6 +8,7 @@
#include "builtin.h"
#include "abspath.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "object-file.h"
@@ -111,7 +112,7 @@ int cmd_hash_object(int argc,
vpath = vpath_free;
}
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
if (stdin_paths) {
if (hashstdin)
diff --git a/builtin/help.c b/builtin/help.c
index c257079ceb..c09cbc8912 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -6,6 +6,7 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "exec-cmd.h"
#include "gettext.h"
#include "pager.h"
@@ -210,7 +211,7 @@ static enum help_format parse_help_format(const char *format)
if (!strcmp(format, "web") || !strcmp(format, "html"))
return HELP_FORMAT_WEB;
/*
- * Please update _git_config() in git-completion.bash when you
+ * Please update _repo_config() in git-completion.bash when you
* add new help formats.
*/
die(_("unrecognized help format '%s'"), format);
@@ -706,7 +707,7 @@ int cmd_help(int argc,
}
setup_git_directory_gently(&nongit);
- git_config(git_help_config, NULL);
+ repo_config(the_repository, git_help_config, NULL);
if (parsed_help_format != HELP_FORMAT_NONE)
help_format = parsed_help_format;
diff --git a/builtin/hook.c b/builtin/hook.c
index 672d2e37e8..7afec380d2 100644
--- a/builtin/hook.c
+++ b/builtin/hook.c
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hook.h"
#include "parse-options.h"
@@ -55,7 +56,7 @@ static int run(int argc, const char **argv, const char *prefix,
strvec_push(&opt.args, argv[i]);
/* Need to take into account core.hooksPath */
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
hook_name = argv[0];
if (!ignore_missing)
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 0a5c8a1ac8..53f1a7cd71 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1917,7 +1917,7 @@ int cmd_index_pack(int argc,
reset_pack_idx_option(&opts);
opts.flags |= WRITE_REV;
- git_config(git_index_pack_config, &opts);
+ repo_config(the_repository, git_index_pack_config, &opts);
if (prefix && chdir(prefix))
die(_("Cannot come back to cwd"));
diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
index 44d8ccddc9..41b0750e5a 100644
--- a/builtin/interpret-trailers.c
+++ b/builtin/interpret-trailers.c
@@ -6,6 +6,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
#include "string-list.h"
@@ -220,7 +221,7 @@ int cmd_interpret_trailers(int argc,
OPT_END()
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options,
git_interpret_trailers_usage, 0);
diff --git a/builtin/log.c b/builtin/log.c
index fb42e094af..c2f8bbf863 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -221,7 +221,7 @@ static void set_default_decoration_filter(struct decoration_filter *decoration_f
struct string_list *include = decoration_filter->include_ref_pattern;
const struct string_list *config_exclude;
- if (!git_config_get_string_multi("log.excludeDecoration",
+ if (!repo_config_get_string_multi(the_repository, "log.excludeDecoration",
&config_exclude)) {
struct string_list_item *item;
for_each_string_list_item(item, config_exclude)
@@ -235,7 +235,7 @@ static void set_default_decoration_filter(struct decoration_filter *decoration_f
* since the command-line takes precedent.
*/
if (use_default_decoration_filter &&
- !git_config_get_string("log.initialdecorationset", &value) &&
+ !repo_config_get_string(the_repository, "log.initialdecorationset", &value) &&
!strcmp("all", value))
use_default_decoration_filter = 0;
free(value);
@@ -530,10 +530,10 @@ int cmd_whatchanged(int argc,
log_config_init(&cfg);
init_diff_ui_defaults();
- git_config(git_log_config, &cfg);
+ repo_config(the_repository, git_log_config, &cfg);
repo_init_revisions(the_repository, &rev, prefix);
- git_config(grep_config, &rev.grep_filter);
+ repo_config(the_repository, grep_config, &rev.grep_filter);
rev.diff = 1;
rev.simplify_history = 0;
@@ -661,7 +661,7 @@ int cmd_show(int argc,
log_config_init(&cfg);
init_diff_ui_defaults();
- git_config(git_log_config, &cfg);
+ repo_config(the_repository, git_log_config, &cfg);
if (the_repository->gitdir) {
prepare_repo_settings(the_repository);
@@ -670,7 +670,7 @@ int cmd_show(int argc,
memset(&match_all, 0, sizeof(match_all));
repo_init_revisions(the_repository, &rev, prefix);
- git_config(grep_config, &rev.grep_filter);
+ repo_config(the_repository, grep_config, &rev.grep_filter);
rev.diff = 1;
rev.always_show_header = 1;
@@ -778,11 +778,11 @@ int cmd_log_reflog(int argc,
log_config_init(&cfg);
init_diff_ui_defaults();
- git_config(git_log_config, &cfg);
+ repo_config(the_repository, git_log_config, &cfg);
repo_init_revisions(the_repository, &rev, prefix);
init_reflog_walk(&rev.reflog_info);
- git_config(grep_config, &rev.grep_filter);
+ repo_config(the_repository, grep_config, &rev.grep_filter);
rev.verbose_header = 1;
memset(&opt, 0, sizeof(opt));
@@ -823,10 +823,10 @@ int cmd_log(int argc,
log_config_init(&cfg);
init_diff_ui_defaults();
- git_config(git_log_config, &cfg);
+ repo_config(the_repository, git_log_config, &cfg);
repo_init_revisions(the_repository, &rev, prefix);
- git_config(grep_config, &rev.grep_filter);
+ repo_config(the_repository, grep_config, &rev.grep_filter);
rev.always_show_header = 1;
memset(&opt, 0, sizeof(opt));
@@ -2029,9 +2029,9 @@ int cmd_format_patch(int argc,
format_config_init(&cfg);
init_diff_ui_defaults();
init_display_notes(&cfg.notes_opt);
- git_config(git_format_config, &cfg);
+ repo_config(the_repository, git_format_config, &cfg);
repo_init_revisions(the_repository, &rev, prefix);
- git_config(grep_config, &rev.grep_filter);
+ repo_config(the_repository, grep_config, &rev.grep_filter);
rev.show_notes = cfg.show_notes;
memcpy(&rev.notes_opt, &cfg.notes_opt, sizeof(cfg.notes_opt));
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index ff975e7be0..c06a6f33e4 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -11,6 +11,7 @@
#include "builtin.h"
#include "config.h"
#include "convert.h"
+#include "environment.h"
#include "quote.h"
#include "dir.h"
#include "gettext.h"
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 4d616dd528..5d55731ca3 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -7,6 +7,7 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "object-name.h"
@@ -375,7 +376,7 @@ int cmd_ls_tree(int argc,
struct object_context obj_context = {0};
int ret;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, ls_tree_options,
ls_tree_usage, 0);
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index 123c81515e..3f82781245 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -2,6 +2,7 @@
#include "builtin.h"
#include "config.h"
#include "commit.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "object-name.h"
@@ -167,7 +168,7 @@ int cmd_merge_base(int argc,
OPT_END()
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, merge_base_usage, 0);
if (cmdmode == 'a') {
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index 9464f27562..3da4ca2c8c 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -97,7 +97,7 @@ int cmd_merge_file(int argc,
if (startup_info->have_repository) {
/* Read the configuration file */
- git_config(git_xmerge_config, NULL);
+ repo_config(the_repository, git_xmerge_config, NULL);
if (0 <= git_xmerge_style)
xmp.style = git_xmerge_style;
}
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index cf8b06cadc..203f0e6456 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+#include "environment.h"
#include "tree-walk.h"
#include "xdiff-interface.h"
#include "help.h"
@@ -683,7 +684,7 @@ int cmd_merge_tree(int argc,
if (argc != expected_remaining_argc)
usage_with_options(merge_tree_usage, mt_options);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
/* Do the relevant type of merge */
if (o.mode == MODE_REAL)
diff --git a/builtin/merge.c b/builtin/merge.c
index 18b22c0a26..dc4cb8fb14 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1392,7 +1392,7 @@ int cmd_merge(int argc,
skip_prefix(branch, "refs/heads/", &branch);
init_diff_ui_defaults();
- git_config(git_merge_config, NULL);
+ repo_config(the_repository, git_merge_config, NULL);
if (!branch || is_null_oid(&head_oid))
head_commit = NULL;
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 27e649736c..e078c97d03 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -98,7 +98,7 @@ int cmd_mktag(int argc,
fsck_set_msg_type_from_ids(&fsck_options, FSCK_MSG_EXTRA_HEADER_ENTRY,
FSCK_WARN);
/* config might set fsck.extraHeaderEntry=* again */
- git_config(git_fsck_config, &fsck_options);
+ repo_config(the_repository, git_fsck_config, &fsck_options);
if (fsck_tag_standalone(NULL, buf.buf, buf.len, &fsck_options,
&tagged_oid, &tagged_type))
die(_("tag on stdin did not pass our strict fsck check"));
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index aa25b06f9d..d3b9e98be3 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -2,6 +2,7 @@
#include "builtin.h"
#include "abspath.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
#include "midx.h"
@@ -143,7 +144,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE;
- git_config(git_multi_pack_index_write_config, NULL);
+ repo_config(the_repository, git_multi_pack_index_write_config, NULL);
options = add_common_options(builtin_multi_pack_index_write_options);
@@ -290,7 +291,7 @@ int cmd_multi_pack_index(int argc,
disable_replace_refs();
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
if (the_repository &&
the_repository->objects &&
diff --git a/builtin/mv.c b/builtin/mv.c
index 07548fe96a..d43925097b 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -239,7 +239,7 @@ int cmd_mv(int argc,
struct strbuf pathbuf = STRBUF_INIT;
int ret;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, builtin_mv_options,
builtin_mv_usage, 0);
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index ff199638de..74512e54a3 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -600,7 +600,7 @@ int cmd_name_rev(int argc,
mem_pool_init(&string_pool, 0);
init_commit_rev_name(&rev_names);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, opts, name_rev_usage, 0);
#ifndef WITH_BREAKING_CHANGES
diff --git a/builtin/notes.c b/builtin/notes.c
index a9529b1696..d2252cf534 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -873,7 +873,7 @@ static int git_config_get_notes_strategy(const char *key,
{
char *value;
- if (git_config_get_string(key, &value))
+ if (repo_config_get_string(the_repository, key, &value))
return 1;
if (parse_notes_merge_strategy(value, strategy))
git_die_config(the_repository, key, _("unknown notes merge strategy %s"), value);
@@ -1145,7 +1145,7 @@ int cmd_notes(int argc,
OPT_END()
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_notes_usage,
PARSE_OPT_SUBCOMMAND_OPTIONAL);
if (!fn) {
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 3dd84495b8..1f084a1b8d 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -4985,7 +4985,7 @@ int cmd_pack_objects(int argc,
reset_pack_idx_option(&pack_idx_opts);
pack_idx_opts.flags |= WRITE_REV;
- git_config(git_pack_config, NULL);
+ repo_config(the_repository, git_pack_config, NULL);
if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
pack_idx_opts.flags &= ~WRITE_REV;
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
index e47bae1c80..5e28d0f9e8 100644
--- a/builtin/pack-refs.c
+++ b/builtin/pack-refs.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
#include "refs.h"
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index 26f04b0335..d26e9d0c1e 100644
--- a/builtin/patch-id.c
+++ b/builtin/patch-id.c
@@ -3,6 +3,7 @@
#include "builtin.h"
#include "config.h"
#include "diff.h"
+#include "environment.h"
#include "gettext.h"
#include "hash.h"
#include "hex.h"
@@ -235,7 +236,7 @@ int cmd_patch_id(int argc,
OPT_END()
};
- git_config(git_patch_id_config, &config);
+ repo_config(the_repository, git_patch_id_config, &config);
/* verbatim implies stable */
if (config.verbatim)
diff --git a/builtin/pull.c b/builtin/pull.c
index 2a6c2e4a37..5ebd529620 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -11,6 +11,7 @@
#include "builtin.h"
#include "advice.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "merge.h"
@@ -313,7 +314,7 @@ static const char *config_get_ff(void)
{
const char *value;
- if (git_config_get_value("pull.ff", &value))
+ if (repo_config_get_value(the_repository, "pull.ff", &value))
return NULL;
switch (git_parse_maybe_bool(value)) {
@@ -344,7 +345,7 @@ static enum rebase_type config_get_rebase(int *rebase_unspecified)
if (curr_branch) {
char *key = xstrfmt("branch.%s.rebase", curr_branch->name);
- if (!git_config_get_value(key, &value)) {
+ if (!repo_config_get_value(the_repository, key, &value)) {
enum rebase_type ret = parse_config_rebase(key, value, 1);
free(key);
return ret;
@@ -353,7 +354,7 @@ static enum rebase_type config_get_rebase(int *rebase_unspecified)
free(key);
}
- if (!git_config_get_value("pull.rebase", &value))
+ if (!repo_config_get_value(the_repository, "pull.rebase", &value))
return parse_config_rebase("pull.rebase", value, 1);
*rebase_unspecified = 1;
@@ -1011,7 +1012,7 @@ int cmd_pull(int argc,
if (!getenv("GIT_REFLOG_ACTION"))
set_reflog_message(argc, argv);
- git_config(git_pull_config, NULL);
+ repo_config(the_repository, git_pull_config, NULL);
if (the_repository->gitdir) {
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/push.c b/builtin/push.c
index 92d530e5c4..d0794b7b30 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -598,7 +598,7 @@ int cmd_push(int argc,
};
packet_trace_identity("push");
- git_config(git_push_config, &flags);
+ repo_config(the_repository, git_push_config, &flags);
argc = parse_options(argc, argv, prefix, options, push_usage, 0);
push_options = (push_options_cmdline.nr
? &push_options_cmdline
diff --git a/builtin/range-diff.c b/builtin/range-diff.c
index 32ddb6613f..a563abff5f 100644
--- a/builtin/range-diff.c
+++ b/builtin/range-diff.c
@@ -54,7 +54,7 @@ int cmd_range_diff(int argc,
struct object_id oid;
const char *three_dots = NULL;
- git_config(git_diff_ui_config, NULL);
+ repo_config(the_repository, git_diff_ui_config, NULL);
repo_diff_setup(the_repository, &diffopt);
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index a8f352f7cd..34f7a59f38 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -6,6 +6,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
@@ -168,7 +169,7 @@ int cmd_read_tree(int argc,
opts.src_index = the_repository->index;
opts.dst_index = the_repository->index;
- git_config(git_read_tree_config, NULL);
+ repo_config(the_repository, git_read_tree_config, NULL);
argc = parse_options(argc, argv, cmd_prefix, read_tree_options,
read_tree_usage, 0);
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 08024e133c..3c85768d29 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;
@@ -1245,7 +1245,7 @@ int cmd_rebase(int argc,
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- git_config(rebase_config, &options);
+ repo_config(the_repository, rebase_config, &options);
/* options.gpg_sign_opt will be either "-S" or NULL */
gpg_sign = options.gpg_sign_opt ? "" : NULL;
FREE_AND_NULL(options.gpg_sign_opt);
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 7974d157eb..82d516a42c 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2613,7 +2613,7 @@ int cmd_receive_pack(int argc,
if (!enter_repo(service_dir, 0))
die("'%s' does not appear to be a git repository", service_dir);
- git_config(receive_pack_config, NULL);
+ repo_config(the_repository, receive_pack_config, NULL);
if (cert_nonce_seed)
push_cert_nonce = prepare_push_cert_nonce(service_dir, time(NULL));
diff --git a/builtin/reflog.c b/builtin/reflog.c
index d4da41aaea..1db26aa65f 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -202,7 +202,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
OPT_END()
};
- git_config(reflog_expire_config, &opts);
+ repo_config(the_repository, reflog_expire_config, &opts);
save_commit_buffer = 0;
do_all = status = 0;
diff --git a/builtin/refs.c b/builtin/refs.c
index 998d2a2c1c..c7ad0a2963 100644
--- a/builtin/refs.c
+++ b/builtin/refs.c
@@ -88,7 +88,7 @@ static int cmd_refs_verify(int argc, const char **argv, const char *prefix,
if (argc)
usage(_("'git refs verify' takes no arguments"));
- git_config(git_fsck_config, &fsck_refs_options);
+ repo_config(the_repository, git_fsck_config, &fsck_refs_options);
prepare_repo_settings(the_repository);
worktrees = get_worktrees_without_reading_head();
diff --git a/builtin/remote.c b/builtin/remote.c
index 5dd6cbbaee..43a122740a 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -132,7 +132,7 @@ static void add_branch(const char *key, const char *branchname,
else
strbuf_addf(tmp, "refs/heads/%s:refs/remotes/%s/%s",
branchname, remotename, branchname);
- git_config_set_multivar(key, tmp->buf, "^$", 0);
+ repo_config_set_multivar(the_repository, key, tmp->buf, "^$", 0);
}
static const char mirror_advice[] =
@@ -226,7 +226,7 @@ static int add(int argc, const char **argv, const char *prefix,
for_each_remote(check_remote_collision, (void *)name);
strbuf_addf(&buf, "remote.%s.url", name);
- git_config_set(buf.buf, url);
+ repo_config_set(the_repository, buf.buf, url);
if (!mirror || mirror & MIRROR_FETCH) {
strbuf_reset(&buf);
@@ -242,14 +242,14 @@ static int add(int argc, const char **argv, const char *prefix,
if (mirror & MIRROR_PUSH) {
strbuf_reset(&buf);
strbuf_addf(&buf, "remote.%s.mirror", name);
- git_config_set(buf.buf, "true");
+ repo_config_set(the_repository, buf.buf, "true");
}
if (fetch_tags != TAGS_DEFAULT) {
strbuf_reset(&buf);
strbuf_addf(&buf, "remote.%s.tagOpt", name);
- git_config_set(buf.buf,
- fetch_tags == TAGS_SET ? "--tags" : "--no-tags");
+ repo_config_set(the_repository, buf.buf,
+ fetch_tags == TAGS_SET ? "--tags" : "--no-tags");
}
if (fetch && fetch_remote(name)) {
@@ -370,7 +370,7 @@ static void read_branches(void)
{
if (branch_list.nr)
return;
- git_config(config_read_branches, NULL);
+ repo_config(the_repository, config_read_branches, NULL);
}
struct ref_states {
@@ -651,15 +651,15 @@ static int migrate_file(struct remote *remote)
strbuf_addf(&buf, "remote.%s.url", remote->name);
for (i = 0; i < remote->url.nr; i++)
- git_config_set_multivar(buf.buf, remote->url.v[i], "^$", 0);
+ repo_config_set_multivar(the_repository, buf.buf, remote->url.v[i], "^$", 0);
strbuf_reset(&buf);
strbuf_addf(&buf, "remote.%s.push", remote->name);
for (i = 0; i < remote->push.nr; i++)
- git_config_set_multivar(buf.buf, remote->push.items[i].raw, "^$", 0);
+ repo_config_set_multivar(the_repository, buf.buf, remote->push.items[i].raw, "^$", 0);
strbuf_reset(&buf);
strbuf_addf(&buf, "remote.%s.fetch", remote->name);
for (i = 0; i < remote->fetch.nr; i++)
- git_config_set_multivar(buf.buf, remote->fetch.items[i].raw, "^$", 0);
+ repo_config_set_multivar(the_repository, buf.buf, remote->fetch.items[i].raw, "^$", 0);
#ifndef WITH_BREAKING_CHANGES
if (remote->origin == REMOTE_REMOTES)
unlink_or_warn(repo_git_path_replace(the_repository, &buf,
@@ -707,12 +707,12 @@ static void handle_push_default(const char* old_name, const char* new_name)
.origin = STRBUF_INIT,
.linenr = -1,
};
- git_config(config_read_push_default, &push_default);
+ repo_config(the_repository, config_read_push_default, &push_default);
if (push_default.scope >= CONFIG_SCOPE_COMMAND)
; /* pass */
else if (push_default.scope >= CONFIG_SCOPE_LOCAL) {
- int result = git_config_set_gently("remote.pushDefault",
- new_name);
+ int result = repo_config_set_gently(the_repository, "remote.pushDefault",
+ new_name);
if (new_name && result && result != CONFIG_NOTHING_SET)
die(_("could not set '%s'"), "remote.pushDefault");
else if (!new_name && result && result != CONFIG_NOTHING_SET)
@@ -788,7 +788,7 @@ static int mv(int argc, const char **argv, const char *prefix,
if (oldremote->fetch.nr) {
strbuf_reset(&buf);
strbuf_addf(&buf, "remote.%s.fetch", rename.new_name);
- git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
+ repo_config_set_multivar(the_repository, buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
strbuf_addf(&old_remote_context, ":refs/remotes/%s/", rename.old_name);
for (i = 0; i < oldremote->fetch.nr; i++) {
char *ptr;
@@ -808,7 +808,7 @@ static int mv(int argc, const char **argv, const char *prefix,
"\tPlease update the configuration manually if necessary."),
buf2.buf);
- git_config_set_multivar(buf.buf, buf2.buf, "^$", 0);
+ repo_config_set_multivar(the_repository, buf.buf, buf2.buf, "^$", 0);
}
}
@@ -819,12 +819,12 @@ static int mv(int argc, const char **argv, const char *prefix,
if (info->remote_name && !strcmp(info->remote_name, rename.old_name)) {
strbuf_reset(&buf);
strbuf_addf(&buf, "branch.%s.remote", item->string);
- git_config_set(buf.buf, rename.new_name);
+ repo_config_set(the_repository, buf.buf, rename.new_name);
}
if (info->push_remote_name && !strcmp(info->push_remote_name, rename.old_name)) {
strbuf_reset(&buf);
strbuf_addf(&buf, "branch.%s.pushRemote", item->string);
- git_config_set(buf.buf, rename.new_name);
+ repo_config_set(the_repository, buf.buf, rename.new_name);
}
}
@@ -951,7 +951,7 @@ static int rm(int argc, const char **argv, const char *prefix,
strbuf_reset(&buf);
strbuf_addf(&buf, "branch.%s.%s",
item->string, *k);
- result = git_config_set_gently(buf.buf, NULL);
+ result = repo_config_set_gently(the_repository, buf.buf, NULL);
if (result && result != CONFIG_NOTHING_SET)
die(_("could not unset '%s'"), buf.buf);
}
@@ -959,7 +959,7 @@ static int rm(int argc, const char **argv, const char *prefix,
if (info->push_remote_name && !strcmp(info->push_remote_name, remote->name)) {
strbuf_reset(&buf);
strbuf_addf(&buf, "branch.%s.pushremote", item->string);
- result = git_config_set_gently(buf.buf, NULL);
+ result = repo_config_set_gently(the_repository, buf.buf, NULL);
if (result && result != CONFIG_NOTHING_SET)
die(_("could not unset '%s'"), buf.buf);
}
@@ -1285,7 +1285,7 @@ static int get_one_entry(struct remote *remote, void *priv)
strbuf_addf(&promisor_config, "remote.%s.partialclonefilter", remote->name);
strbuf_addf(&remote_info_buf, "%s (fetch)", remote->url.v[0]);
- if (!git_config_get_string_tmp(promisor_config.buf, &partial_clone_filter))
+ if (!repo_config_get_string_tmp(the_repository, promisor_config.buf, &partial_clone_filter))
strbuf_addf(&remote_info_buf, " [%s]", partial_clone_filter);
strbuf_release(&promisor_config);
@@ -1520,7 +1520,7 @@ static int set_head(int argc, const char **argv, const char *prefix,
struct strbuf config_name = STRBUF_INIT;
strbuf_addf(&config_name,
"remote.%s.followremotehead", remote->name);
- git_config_set(config_name.buf, "warn");
+ repo_config_set(the_repository, config_name.buf, "warn");
strbuf_release(&config_name);
}
@@ -1637,7 +1637,7 @@ static int update(int argc, const char **argv, const char *prefix,
strvec_push(&cmd.args, argv[i]);
if (strcmp(cmd.args.v[cmd.args.nr-1], "default") == 0) {
- git_config(get_remote_default, &default_defined);
+ repo_config(the_repository, get_remote_default, &default_defined);
if (!default_defined) {
strvec_pop(&cmd.args);
strvec_push(&cmd.args, "--all");
@@ -1650,8 +1650,8 @@ static int update(int argc, const char **argv, const char *prefix,
static int remove_all_fetch_refspecs(const char *key)
{
- return git_config_set_multivar_gently(key, NULL, NULL,
- CONFIG_FLAGS_MULTI_REPLACE);
+ return repo_config_set_multivar_gently(the_repository, key, NULL, NULL,
+ CONFIG_FLAGS_MULTI_REPLACE);
}
static void add_branches(struct remote *remote, const char **branches,
@@ -1807,10 +1807,10 @@ static int set_url(int argc, const char **argv, const char *prefix,
/* Special cases that add new entry. */
if ((!oldurl && !delete_mode) || add_mode) {
if (add_mode)
- git_config_set_multivar(name_buf.buf, newurl,
+ repo_config_set_multivar(the_repository, name_buf.buf, newurl,
"^$", 0);
else
- git_config_set(name_buf.buf, newurl);
+ repo_config_set(the_repository, name_buf.buf, newurl);
goto out;
}
@@ -1831,10 +1831,10 @@ static int set_url(int argc, const char **argv, const char *prefix,
regfree(&old_regex);
if (!delete_mode)
- git_config_set_multivar(name_buf.buf, newurl, oldurl, 0);
+ repo_config_set_multivar(the_repository, name_buf.buf, newurl, oldurl, 0);
else
- git_config_set_multivar(name_buf.buf, NULL, oldurl,
- CONFIG_FLAGS_MULTI_REPLACE);
+ repo_config_set_multivar(the_repository, name_buf.buf, NULL, oldurl,
+ CONFIG_FLAGS_MULTI_REPLACE);
out:
strbuf_release(&name_buf);
return 0;
diff --git a/builtin/repack.c b/builtin/repack.c
index 21723866b9..a4def39197 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1340,7 +1340,7 @@ int cmd_repack(int argc,
list_objects_filter_init(&po_args.filter_options);
- git_config(repack_config, &cruft_po_args);
+ repo_config(the_repository, repack_config, &cruft_po_args);
argc = parse_options(argc, argv, prefix, builtin_repack_options,
git_repack_usage, 0);
diff --git a/builtin/replace.c b/builtin/replace.c
index 5ff2ab723c..19897ef927 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -11,6 +11,7 @@
#include "builtin.h"
#include "config.h"
#include "editor.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "refs.h"
@@ -574,7 +575,7 @@ int cmd_replace(int argc,
};
disable_replace_refs();
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
diff --git a/builtin/rerere.c b/builtin/rerere.c
index 1312e79d89..a056cb791b 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -66,7 +66,7 @@ int cmd_rerere(int argc,
argc = parse_options(argc, argv, prefix, options, rerere_usage, 0);
- git_config(git_xmerge_config, NULL);
+ repo_config(the_repository, git_xmerge_config, NULL);
if (autoupdate == 1)
flags = RERERE_AUTOUPDATE;
diff --git a/builtin/reset.c b/builtin/reset.c
index dc50ffc1ac..00492c19b0 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -377,7 +377,7 @@ int cmd_reset(int argc,
OPT_END()
};
- git_config(git_reset_config, NULL);
+ repo_config(the_repository, git_reset_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_reset_usage,
PARSE_OPT_KEEP_DASHDASH);
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 97a3af36ec..99f876ba85 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -644,7 +644,7 @@ int cmd_rev_list(int argc,
show_usage_if_asked(argc, argv, rev_list_usage);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
repo_init_revisions(the_repository, &revs, prefix);
revs.abbrev = DEFAULT_ABBREV;
revs.commit_format = CMIT_FMT_UNSPECIFIED;
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 490da33bec..44ff1b8342 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -734,7 +734,7 @@ int cmd_rev_parse(int argc,
/* No options; just report on whether we're in a git repo or not. */
if (argc == 1) {
setup_git_directory();
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
return 0;
}
@@ -769,7 +769,7 @@ int cmd_rev_parse(int argc,
/* The rest of the options require a git repository. */
if (!did_repo_setup) {
prefix = setup_git_directory();
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
did_repo_setup = 1;
prepare_repo_settings(the_repository);
diff --git a/builtin/rm.c b/builtin/rm.c
index a6565a69cf..05d89e98c3 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -9,6 +9,7 @@
#include "builtin.h"
#include "advice.h"
#include "config.h"
+#include "environment.h"
#include "lockfile.h"
#include "dir.h"
#include "gettext.h"
@@ -271,7 +272,7 @@ int cmd_rm(int argc,
struct pathspec pathspec;
char *seen;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, builtin_rm_options,
builtin_rm_usage, 0);
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 28b69d26b4..8b81c8a848 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "hex.h"
#include "pkt-line.h"
#include "run-command.h"
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 60adc5e7a5..b91acf45c8 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -421,7 +421,7 @@ int cmd_shortlog(int argc,
if (nongit && !the_hash_algo)
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
shortlog_init(&log);
repo_init_revisions(the_repository, &rev, prefix);
parse_options_start(&ctx, argc, argv, prefix, options,
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 525b231d87..1ab7db9d2c 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -710,7 +710,7 @@ int cmd_show_branch(int ac,
init_commit_name_slab(&name_slab);
- git_config(git_show_branch_config, NULL);
+ repo_config(the_repository, git_show_branch_config, NULL);
/* If nothing is specified, try the default first */
if (ac == 1 && default_args.nr) {
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 117709cb07..0b6f9edf86 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "refs/refs-internal.h"
@@ -324,7 +325,7 @@ struct repository *repo UNUSED)
OPT_END()
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, show_ref_options,
show_ref_usage, 0);
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 1bf01591b2..8c333b3e2e 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -1082,7 +1082,7 @@ int cmd_sparse_checkout(int argc,
builtin_sparse_checkout_options,
builtin_sparse_checkout_usage, 0);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/stash.c b/builtin/stash.c
index e2f95cc2eb..821b58a14e 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -979,7 +979,7 @@ static int show_stash(int argc, const char **argv, const char *prefix,
int do_usage = 0;
init_diff_ui_defaults();
- git_config(git_diff_ui_config, NULL);
+ repo_config(the_repository, git_diff_ui_config, NULL);
repo_init_revisions(the_repository, &rev, prefix);
argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
@@ -2358,7 +2358,7 @@ int cmd_stash(int argc,
const char **args_copy;
int ret;
- git_config(git_stash_config, NULL);
+ repo_config(the_repository, git_stash_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_stash_usage,
PARSE_OPT_SUBCOMMAND_OPTIONAL |
diff --git a/builtin/stripspace.c b/builtin/stripspace.c
index e147f3ff92..4a566cbc5d 100644
--- a/builtin/stripspace.c
+++ b/builtin/stripspace.c
@@ -55,7 +55,7 @@ int cmd_stripspace(int argc,
if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
setup_git_directory_gently(&nongit);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
}
if (strbuf_read(&buf, 0, 1024) < 0)
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index d8a6fa47e5..28f34f7bc1 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -53,7 +53,7 @@ static char *resolve_relative_url(const char *rel_url, const char *up_path, int
struct strbuf remotesb = STRBUF_INIT;
strbuf_addf(&remotesb, "remote.%s.url", remote);
- if (git_config_get_string(remotesb.buf, &remoteurl)) {
+ if (repo_config_get_string(the_repository, remotesb.buf, &remoteurl)) {
if (!quiet)
warning(_("could not look up configuration '%s'. "
"Assuming this repository is its own "
@@ -458,7 +458,7 @@ static void init_submodule(const char *path, const char *prefix,
*/
if (!is_submodule_active(the_repository, path)) {
strbuf_addf(&sb, "submodule.%s.active", sub->name);
- git_config_set_gently(sb.buf, "true");
+ repo_config_set_gently(the_repository, sb.buf, "true");
strbuf_reset(&sb);
}
@@ -468,7 +468,7 @@ static void init_submodule(const char *path, const char *prefix,
* .gitmodules, so look it up directly.
*/
strbuf_addf(&sb, "submodule.%s.url", sub->name);
- if (git_config_get_string(sb.buf, &url)) {
+ if (repo_config_get_string(the_repository, sb.buf, &url)) {
if (!sub->url)
die(_("No url found for submodule path '%s' in .gitmodules"),
displaypath);
@@ -484,7 +484,7 @@ static void init_submodule(const char *path, const char *prefix,
free(oldurl);
}
- if (git_config_set_gently(sb.buf, url))
+ if (repo_config_set_gently(the_repository, sb.buf, url))
die(_("Failed to register url for submodule path '%s'"),
displaypath);
if (!(flags & OPT_QUIET))
@@ -496,7 +496,7 @@ static void init_submodule(const char *path, const char *prefix,
/* Copy "update" setting when it is not set yet */
strbuf_addf(&sb, "submodule.%s.update", sub->name);
- if (git_config_get_string_tmp(sb.buf, &upd) &&
+ if (repo_config_get_string_tmp(the_repository, sb.buf, &upd) &&
sub->update_strategy.type != SM_UPDATE_UNSPECIFIED) {
if (sub->update_strategy.type == SM_UPDATE_COMMAND) {
fprintf(stderr, _("warning: command update mode suggested for submodule '%s'\n"),
@@ -506,7 +506,7 @@ static void init_submodule(const char *path, const char *prefix,
upd = submodule_update_type_to_string(sub->update_strategy.type);
}
- if (git_config_set_gently(sb.buf, upd))
+ if (repo_config_set_gently(the_repository, sb.buf, upd))
die(_("Failed to register update mode for submodule path '%s'"), displaypath);
}
strbuf_release(&sb);
@@ -549,7 +549,7 @@ static int module_init(int argc, const char **argv, const char *prefix,
* If there are no path args and submodule.active is set then,
* by default, only initialize 'active' modules.
*/
- if (!argc && !git_config_get("submodule.active"))
+ if (!argc && !repo_config_get(the_repository, "submodule.active"))
module_list_active(&list);
info.prefix = prefix;
@@ -649,7 +649,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
"--ignore-submodules=dirty", "--quiet", "--",
path, NULL);
- git_config(git_diff_basic_config, NULL);
+ repo_config(the_repository, git_diff_basic_config, NULL);
repo_init_revisions(the_repository, &rev, NULL);
rev.abbrev = 0;
@@ -1034,7 +1034,7 @@ static void prepare_submodule_summary(struct summary_cb *info,
config_key = xstrfmt("submodule.%s.ignore",
sub->name);
- if (!git_config_get_string_tmp(config_key, &value))
+ if (!repo_config_get_string_tmp(the_repository, config_key, &value))
ignore_all = !strcmp(value, "all");
else if (sub->ignore)
ignore_all = !strcmp(sub->ignore, "all");
@@ -1108,7 +1108,7 @@ static int compute_summary_module_list(struct object_id *head_oid,
if (info->argc)
strvec_pushv(&diff_args, info->argv);
- git_config(git_diff_basic_config, NULL);
+ repo_config(the_repository, git_diff_basic_config, NULL);
repo_init_revisions(the_repository, &rev, info->prefix);
rev.abbrev = 0;
precompose_argv_prefix(diff_args.nr, diff_args.v, NULL);
@@ -1262,7 +1262,7 @@ static void sync_submodule(const char *path, const char *prefix,
strbuf_reset(&sb);
strbuf_addf(&sb, "submodule.%s.url", sub->name);
- if (git_config_set_gently(sb.buf, super_config_url))
+ if (repo_config_set_gently(the_repository, sb.buf, super_config_url))
die(_("failed to register url for submodule path '%s'"),
displaypath);
@@ -1280,7 +1280,7 @@ static void sync_submodule(const char *path, const char *prefix,
submodule_to_gitdir(the_repository, &sb, path);
strbuf_addstr(&sb, "/config");
- if (git_config_set_in_file_gently(sb.buf, remote_key, NULL, sub_origin_url))
+ if (repo_config_set_in_file_gently(the_repository, sb.buf, remote_key, NULL, sub_origin_url))
die(_("failed to update remote for submodule '%s'"),
path);
@@ -1623,11 +1623,11 @@ static void prepare_possible_alternates(const char *sm_name,
char *sm_alternate = NULL, *error_strategy = NULL;
struct submodule_alternate_setup sas = SUBMODULE_ALTERNATE_SETUP_INIT;
- git_config_get_string("submodule.alternateLocation", &sm_alternate);
+ repo_config_get_string(the_repository, "submodule.alternateLocation", &sm_alternate);
if (!sm_alternate)
return;
- git_config_get_string("submodule.alternateErrorStrategy", &error_strategy);
+ repo_config_get_string(the_repository, "submodule.alternateErrorStrategy", &error_strategy);
if (!error_strategy)
error_strategy = xstrdup("die");
@@ -1808,14 +1808,14 @@ static int clone_submodule(const struct module_clone_data *clone_data,
die(_("could not get submodule directory for '%s'"), clone_data_path);
/* setup alternateLocation and alternateErrorStrategy in the cloned submodule if needed */
- git_config_get_string("submodule.alternateLocation", &sm_alternate);
+ repo_config_get_string(the_repository, "submodule.alternateLocation", &sm_alternate);
if (sm_alternate)
- git_config_set_in_file(p, "submodule.alternateLocation",
- sm_alternate);
- git_config_get_string("submodule.alternateErrorStrategy", &error_strategy);
+ repo_config_set_in_file(the_repository, p, "submodule.alternateLocation",
+ sm_alternate);
+ repo_config_get_string(the_repository, "submodule.alternateErrorStrategy", &error_strategy);
if (error_strategy)
- git_config_set_in_file(p, "submodule.alternateErrorStrategy",
- error_strategy);
+ repo_config_set_in_file(the_repository, p, "submodule.alternateErrorStrategy",
+ error_strategy);
free(sm_alternate);
free(error_strategy);
@@ -2522,7 +2522,7 @@ static int ensure_core_worktree(const char *path)
abs_path = absolute_pathdup(path);
rel_path = relative_path(abs_path, subrepo.gitdir, &sb);
- git_config_set_in_file(cfg_file, "core.worktree", rel_path);
+ repo_config_set_in_file(the_repository, cfg_file, "core.worktree", rel_path);
free(cfg_file);
free(abs_path);
@@ -2830,7 +2830,7 @@ static int module_update(int argc, const char **argv, const char *prefix,
};
update_clone_config_from_gitmodules(&opt.max_jobs);
- git_config(git_update_clone_config, &opt.max_jobs);
+ repo_config(the_repository, git_update_clone_config, &opt.max_jobs);
argc = parse_options(argc, argv, prefix, module_update_options,
git_submodule_helper_usage, 0);
@@ -2878,7 +2878,7 @@ static int module_update(int argc, const char **argv, const char *prefix,
* If there are no path args and submodule.active is set then,
* by default, only initialize 'active' modules.
*/
- if (!argc && !git_config_get("submodule.active"))
+ if (!argc && !repo_config_get(the_repository, "submodule.active"))
module_list_active(&list);
info.prefix = opt.prefix;
@@ -3128,7 +3128,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix,
NULL
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
track = git_branch_track;
argc = parse_options(argc, argv, prefix, options, usage, 0);
@@ -3309,7 +3309,7 @@ static void configure_added_submodule(struct add_data *add_data)
struct child_process add_gitmodules = CHILD_PROCESS_INIT;
key = xstrfmt("submodule.%s.url", add_data->sm_name);
- git_config_set_gently(key, add_data->realrepo);
+ repo_config_set_gently(the_repository, key, add_data->realrepo);
free(key);
add_submod.git_cmd = 1;
@@ -3349,19 +3349,19 @@ static void configure_added_submodule(struct add_data *add_data)
* is_submodule_active(), since that function needs to find
* out the value of "submodule.active" again anyway.
*/
- if (!git_config_get("submodule.active")) {
+ if (!repo_config_get(the_repository, "submodule.active")) {
/*
* If the submodule being added isn't already covered by the
* current configured pathspec, set the submodule's active flag
*/
if (!is_submodule_active(the_repository, add_data->sm_path)) {
key = xstrfmt("submodule.%s.active", add_data->sm_name);
- git_config_set_gently(key, "true");
+ repo_config_set_gently(the_repository, key, "true");
free(key);
}
} else {
key = xstrfmt("submodule.%s.active", add_data->sm_name);
- git_config_set_gently(key, "true");
+ repo_config_set_gently(the_repository, key, "true");
free(key);
}
}
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c
index 299d23d76a..231e41e715 100644
--- a/builtin/symbolic-ref.c
+++ b/builtin/symbolic-ref.c
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "refs.h"
#include "parse-options.h"
@@ -59,7 +60,7 @@ int cmd_symbolic_ref(int argc,
OPT_END(),
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options,
git_symbolic_ref_usage, 0);
if (msg && !*msg)
diff --git a/builtin/tag.c b/builtin/tag.c
index 46cbf892e3..25f30e3f9b 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -546,7 +546,7 @@ int cmd_tag(int argc,
* Try to set sort keys from config. If config does not set any,
* fall back on default (refname) sorting.
*/
- git_config(git_tag_config, &sorting_options);
+ repo_config(the_repository, git_tag_config, &sorting_options);
if (!sorting_options.nr)
string_list_append(&sorting_options, "refname");
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 4360872ae0..87877a9fab 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "hex.h"
#include "object-file.h"
#include "object-name.h"
@@ -43,7 +44,7 @@ int cmd_unpack_file(int argc,
if (repo_get_oid(the_repository, argv[1], &oid))
die("Not a valid object name %s", argv[1]);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
puts(create_temp_file(&oid));
return 0;
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index a69d59eb50..26aa885da9 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -621,7 +621,7 @@ int cmd_unpack_objects(int argc,
disable_replace_refs();
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
quiet = !isatty(2);
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 0c1d4ed55b..2380f3ccd6 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -1103,7 +1103,7 @@ int cmd_update_index(int argc,
show_usage_with_options_if_asked(argc, argv,
update_index_usage, options);
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
prepare_repo_settings(r);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index 1e6131e04a..195437e7c6 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -3,6 +3,7 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hash.h"
#include "hex.h"
@@ -769,7 +770,7 @@ int cmd_update_ref(int argc,
OPT_END(),
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_update_ref_usage,
0);
if (msg && !*msg)
diff --git a/builtin/update-server-info.c b/builtin/update-server-info.c
index ba702d30ef..4c12968a83 100644
--- a/builtin/update-server-info.c
+++ b/builtin/update-server-info.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
#include "server-info.h"
diff --git a/builtin/var.c b/builtin/var.c
index ada642a9fe..a2d790d453 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -11,6 +11,7 @@
#include "attr.h"
#include "config.h"
#include "editor.h"
+#include "environment.h"
#include "ident.h"
#include "pager.h"
#include "refs.h"
@@ -226,11 +227,11 @@ int cmd_var(int argc,
usage(var_usage);
if (strcmp(argv[1], "-l") == 0) {
- git_config(show_config, NULL);
+ repo_config(the_repository, show_config, NULL);
list_vars();
return 0;
}
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
git_var = get_git_var(argv[1]);
if (!git_var)
diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c
index 5f749a30da..62398acd72 100644
--- a/builtin/verify-commit.c
+++ b/builtin/verify-commit.c
@@ -7,6 +7,7 @@
*/
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "object-name.h"
#include "commit.h"
diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c
index 34e4ed715f..65fd6629a0 100644
--- a/builtin/verify-pack.c
+++ b/builtin/verify-pack.c
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "run-command.h"
#include "parse-options.h"
@@ -81,7 +82,7 @@ int cmd_verify_pack(int argc,
OPT_END()
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, verify_pack_options,
verify_pack_usage, 0);
if (argc < 1)
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index ed1c40338f..cd6bc11095 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -7,6 +7,7 @@
*/
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "tag.h"
#include "object-name.h"
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 2dceeeed8b..812774a5ca 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -379,13 +379,13 @@ static void copy_filtered_worktree_config(const char *worktree_git_dir)
if (!git_configset_get_bool(&cs, "core.bare", &bare) &&
bare &&
- git_config_set_multivar_in_file_gently(
+ repo_config_set_multivar_in_file_gently(the_repository,
to_file, "core.bare", NULL, "true", NULL, 0))
error(_("failed to unset '%s' in '%s'"),
"core.bare", to_file);
if (!git_configset_get(&cs, "core.worktree") &&
- git_config_set_in_file_gently(to_file,
- "core.worktree", NULL, NULL))
+ repo_config_set_in_file_gently(the_repository, to_file,
+ "core.worktree", NULL, NULL))
error(_("failed to unset '%s' in '%s'"),
"core.worktree", to_file);
@@ -1448,7 +1448,7 @@ int cmd_worktree(int ac,
OPT_END()
};
- git_config(git_worktree_config, NULL);
+ repo_config(the_repository, git_worktree_config, NULL);
if (!prefix)
prefix = "";
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index cfec044710..e3bd1a40db 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -6,6 +6,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "tree.h"
@@ -43,7 +44,7 @@ int cmd_write_tree(int argc,
OPT_END()
};
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, cmd_prefix, write_tree_options,
write_tree_usage, 0);