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);
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);
}
}
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);
}
options);
/* Disable foreground maintenance */
- git_config_set("maintenance.auto", "false");
+ repo_config_set(the_repository, "maintenance.auto", "false");
/* Set maintenance strategy, if unset */
if (repo_config_get(the_repository, "maintenance.strategy"))
- git_config_set("maintenance.strategy", "incremental");
+ repo_config_set(the_repository, "maintenance.strategy", "incremental");
if (!repo_config_get_string_multi(the_repository, key, &list)) {
for_each_string_list_item(item, list) {
die(_("'%s' is not a valid remote name"), 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);
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)) {
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);
}
}
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);
}
git_config_set_multivar(name_buf.buf, newurl,
"^$", 0);
else
- git_config_set(name_buf.buf, newurl);
+ repo_config_set(the_repository, name_buf.buf, newurl);
goto out;
}
close(output_fd);
repo_git_path_replace(the_repository, &path, "%s", auml_nfd);
precomposed_unicode = access(path.buf, R_OK) ? 0 : 1;
- git_config_set("core.precomposeunicode",
- precomposed_unicode ? "true" : "false");
+ repo_config_set(the_repository, "core.precomposeunicode",
+ precomposed_unicode ? "true" : "false");
repo_git_path_replace(the_repository, &path, "%s", auml_nfc);
if (unlink(path.buf))
die_errno(_("failed to unlink '%s'"), path.buf);
}
/*
- * Find all the stuff for git_config_set() below.
+ * Find all the stuff for repo_config_set() below.
*/
struct config_store_data {
return repo_config_get_pathname(the_repository, key, dest);
}
-static inline void git_config_set(const char *key, const char *value)
-{
- repo_config_set(the_repository, key, value);
-}
-
static inline int git_config_set_in_file_gently(
const char *config_filename,
const char *key,
/* Add promisor config for the remote */
cfg_name = xstrfmt("remote.%s.promisor", remote);
- git_config_set(cfg_name, "true");
+ repo_config_set(the_repository, cfg_name, "true");
free(cfg_name);
}
*/
filter_name = xstrfmt("remote.%s.partialclonefilter", remote);
/* NEEDSWORK: 'expand' result leaking??? */
- git_config_set(filter_name,
- expand_list_objects_filter_spec(filter_options));
+ repo_config_set(the_repository, filter_name,
+ expand_list_objects_filter_spec(filter_options));
free(filter_name);
/* Make sure the config info are reset */
}
strbuf_addf(&repo_version, "%d", target_version);
- git_config_set("core.repositoryformatversion", repo_version.buf);
+ repo_config_set(the_repository, "core.repositoryformatversion", repo_version.buf);
ret = 1;
target_version = GIT_REPO_VERSION_READ;
if (hash_algo != GIT_HASH_SHA1_LEGACY && hash_algo != GIT_HASH_UNKNOWN)
- git_config_set("extensions.objectformat",
- hash_algos[hash_algo].name);
+ repo_config_set(the_repository, "extensions.objectformat",
+ hash_algos[hash_algo].name);
else if (reinit)
repo_config_set_gently(the_repository, "extensions.objectformat", NULL);
if (ref_storage_format != REF_STORAGE_FORMAT_FILES)
- git_config_set("extensions.refstorage",
- ref_storage_format_to_name(ref_storage_format));
+ repo_config_set(the_repository, "extensions.refstorage",
+ ref_storage_format_to_name(ref_storage_format));
else if (reinit)
repo_config_set_gently(the_repository, "extensions.refstorage", NULL);
}
strbuf_addf(&repo_version, "%d", target_version);
- git_config_set("core.repositoryformatversion", repo_version.buf);
+ repo_config_set(the_repository, "core.repositoryformatversion", repo_version.buf);
strbuf_release(&repo_version);
}
if (filemode && !reinit && (st1.st_mode & S_IXUSR))
filemode = 0;
}
- git_config_set("core.filemode", filemode ? "true" : "false");
+ repo_config_set(the_repository, "core.filemode", filemode ? "true" : "false");
if (is_bare_repository())
- git_config_set("core.bare", "true");
+ repo_config_set(the_repository, "core.bare", "true");
else {
- git_config_set("core.bare", "false");
+ repo_config_set(the_repository, "core.bare", "false");
/* allow template config file to override the default */
if (repo_settings_get_log_all_ref_updates(the_repository) == LOG_REFS_UNSET)
- git_config_set("core.logallrefupdates", "true");
+ repo_config_set(the_repository, "core.logallrefupdates", "true");
if (needs_work_tree_config(original_git_dir, work_tree))
- git_config_set("core.worktree", work_tree);
+ repo_config_set(the_repository, "core.worktree", work_tree);
}
if (!reinit) {
S_ISLNK(st1.st_mode))
unlink(path.buf); /* good */
else
- git_config_set("core.symlinks", "false");
+ repo_config_set(the_repository, "core.symlinks", "false");
/* Check if the filesystem is case-insensitive */
repo_git_path_replace(the_repository, &path, "CoNfIg");
if (!access(path.buf, F_OK))
- git_config_set("core.ignorecase", "true");
+ repo_config_set(the_repository, "core.ignorecase", "true");
probe_utf8_pathname_composition();
}
xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_EVERYBODY);
else
BUG("invalid value for shared_repository");
- git_config_set("core.sharedrepository", buf);
- git_config_set("receive.denyNonFastforwards", "true");
+ repo_config_set(the_repository, "core.sharedrepository", buf);
+ repo_config_set(the_repository, "receive.denyNonFastforwards", "true");
}
if (!(flags & INIT_DB_QUIET)) {