Skip to content

Commit 084681b

Browse files
committed
Merge branch 'ps/config-wo-the-repository' into pw/3.0-commentchar-auto-deprecation
* ps/config-wo-the-repository: (21 commits) config: fix sign comparison warnings config: move Git config parsing into "environment.c" config: remove unused `the_repository` wrappers config: drop `git_config_set_multivar()` wrapper config: drop `git_config_get_multivar_gently()` wrapper config: drop `git_config_set_multivar_in_file_gently()` wrapper config: drop `git_config_set_in_file_gently()` wrapper config: drop `git_config_set()` wrapper config: drop `git_config_set_gently()` wrapper config: drop `git_config_set_in_file()` wrapper config: drop `git_config_get_bool()` wrapper config: drop `git_config_get_ulong()` wrapper config: drop `git_config_get_int()` wrapper config: drop `git_config_get_string()` wrapper config: drop `git_config_get_string()` wrapper config: drop `git_config_get_string_multi()` wrapper config: drop `git_config_get_value()` wrapper config: drop `git_config_get_value()` wrapper config: drop `git_config_get()` wrapper config: drop `git_config_clear()` wrapper ...
2 parents e813a02 + b06408b commit 084681b

File tree

161 files changed

+1017
-1099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1017
-1099
lines changed

Documentation/user-manual.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4270,7 +4270,7 @@ So, look into `builtin/cat-file.c`, search for `cmd_cat_file()` and look what
42704270
it does.
42714271

42724272
------------------------------------------------------------------
4273-
git_config(git_default_config);
4273+
repo_config(the_repository, git_default_config);
42744274
if (argc != 3)
42754275
usage("git cat-file [-t|-s|-e|-p|<type>] <sha1>");
42764276
if (get_sha1(argv[2], sha1))

apply.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ struct gitdiff_data {
4848

4949
static void git_apply_config(void)
5050
{
51-
git_config_get_string("apply.whitespace", &apply_default_whitespace);
52-
git_config_get_string("apply.ignorewhitespace", &apply_default_ignorewhitespace);
53-
git_config(git_xmerge_config, NULL);
51+
repo_config_get_string(the_repository, "apply.whitespace", &apply_default_whitespace);
52+
repo_config_get_string(the_repository, "apply.ignorewhitespace", &apply_default_ignorewhitespace);
53+
repo_config(the_repository, git_xmerge_config, NULL);
5454
}
5555

5656
static int parse_whitespace_option(struct apply_state *state, const char *option)

archive-tar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ void init_tar_archiver(void)
537537
tar_filter_config("tar.tgz.remote", "true", NULL);
538538
tar_filter_config("tar.tar.gz.command", internal_gzip_command, NULL);
539539
tar_filter_config("tar.tar.gz.remote", "true", NULL);
540-
git_config(git_tar_config, NULL);
540+
repo_config(the_repository, git_tar_config, NULL);
541541
for (i = 0; i < nr_tar_filters; i++) {
542542
/* omit any filters that never had a command configured */
543543
if (tar_filters[i]->filter_command)

archive-zip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static int write_zip_archive(const struct archiver *ar UNUSED,
632632
{
633633
int err;
634634

635-
git_config(archive_zip_config, NULL);
635+
repo_config(the_repository, archive_zip_config, NULL);
636636

637637
dos_time(&args->time, &zip_date, &zip_time);
638638

archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,8 @@ int write_archive(int argc, const char **argv, const char *prefix,
760760
const char **argv_copy;
761761
int rc;
762762

763-
git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable);
764-
git_config(git_default_config, NULL);
763+
repo_config_get_bool(the_repository, "uploadarchive.allowunreachable", &remote_allow_unreachable);
764+
repo_config(the_repository, git_default_config, NULL);
765765

766766
describe_status.max_invocations = 1;
767767
ctx.date_mode.type = DATE_NORMAL;

branch.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int install_branch_config_multiple_remotes(int flag, const char *local,
116116
}
117117

118118
strbuf_addf(&key, "branch.%s.remote", local);
119-
if (git_config_set_gently(key.buf, origin ? origin : ".") < 0)
119+
if (repo_config_set_gently(the_repository, key.buf, origin ? origin : ".") < 0)
120120
goto out_err;
121121

122122
strbuf_reset(&key);
@@ -127,16 +127,16 @@ static int install_branch_config_multiple_remotes(int flag, const char *local,
127127
* more than one is provided, use CONFIG_REGEX_NONE to preserve what
128128
* we've written so far.
129129
*/
130-
if (git_config_set_gently(key.buf, NULL) < 0)
130+
if (repo_config_set_gently(the_repository, key.buf, NULL) < 0)
131131
goto out_err;
132132
for_each_string_list_item(item, remotes)
133-
if (git_config_set_multivar_gently(key.buf, item->string, CONFIG_REGEX_NONE, 0) < 0)
133+
if (repo_config_set_multivar_gently(the_repository, key.buf, item->string, CONFIG_REGEX_NONE, 0) < 0)
134134
goto out_err;
135135

136136
if (rebasing) {
137137
strbuf_reset(&key);
138138
strbuf_addf(&key, "branch.%s.rebase", local);
139-
if (git_config_set_gently(key.buf, "true") < 0)
139+
if (repo_config_set_gently(the_repository, key.buf, "true") < 0)
140140
goto out_err;
141141
}
142142
strbuf_release(&key);
@@ -355,7 +355,7 @@ int read_branch_desc(struct strbuf *buf, const char *branch_name)
355355
char *v = NULL;
356356
struct strbuf name = STRBUF_INIT;
357357
strbuf_addf(&name, "branch.%s.description", branch_name);
358-
if (git_config_get_string(name.buf, &v)) {
358+
if (repo_config_get_string(the_repository, name.buf, &v)) {
359359
strbuf_release(&name);
360360
return -1;
361361
}

builtin/add.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "builtin.h"
88
#include "advice.h"
99
#include "config.h"
10+
#include "environment.h"
1011
#include "lockfile.h"
1112
#include "editor.h"
1213
#include "dir.h"

builtin/am.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,18 @@ static void am_state_init(struct am_state *state)
162162

163163
state->prec = 4;
164164

165-
git_config_get_bool("am.threeway", &state->threeway);
165+
repo_config_get_bool(the_repository, "am.threeway", &state->threeway);
166166

167167
state->utf8 = 1;
168168

169-
git_config_get_bool("am.messageid", &state->message_id);
169+
repo_config_get_bool(the_repository, "am.messageid", &state->message_id);
170170

171171
state->scissors = SCISSORS_UNSET;
172172
state->quoted_cr = quoted_cr_unset;
173173

174174
strvec_init(&state->git_apply_opts);
175175

176-
if (!git_config_get_bool("commit.gpgsign", &gpgsign))
176+
if (!repo_config_get_bool(the_repository, "commit.gpgsign", &gpgsign))
177177
state->sign_commit = gpgsign ? "" : NULL;
178178
}
179179

@@ -965,7 +965,7 @@ static int split_mail(struct am_state *state, enum patch_format patch_format,
965965
{
966966
if (keep_cr < 0) {
967967
keep_cr = 0;
968-
git_config_get_bool("am.keepcr", &keep_cr);
968+
repo_config_get_bool(the_repository, "am.keepcr", &keep_cr);
969969
}
970970

971971
switch (patch_format) {
@@ -2445,7 +2445,7 @@ int cmd_am(int argc,
24452445

24462446
show_usage_with_options_if_asked(argc, argv, usage, options);
24472447

2448-
git_config(git_default_config, NULL);
2448+
repo_config(the_repository, git_default_config, NULL);
24492449

24502450
am_state_init(&state);
24512451

builtin/blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ int cmd_blame(int argc,
947947
const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
948948

949949
setup_default_color_by_age();
950-
git_config(git_blame_config, &output_option);
950+
repo_config(the_repository, git_blame_config, &output_option);
951951
repo_init_revisions(the_repository, &revs, NULL);
952952
revs.date_mode = blame_date_mode;
953953
revs.diffopt.flags.allow_textconv = 1;

builtin/branch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static int edit_branch_description(const char *branch_name)
699699

700700
strbuf_addf(&name, "branch.%s.description", branch_name);
701701
if (buf.len || exists)
702-
git_config_set(name.buf, buf.len ? buf.buf : NULL);
702+
repo_config_set(the_repository, name.buf, buf.len ? buf.buf : NULL);
703703
strbuf_release(&name);
704704
strbuf_release(&buf);
705705

@@ -791,7 +791,7 @@ int cmd_branch(int argc,
791791
* Try to set sort keys from config. If config does not set any,
792792
* fall back on default (refname) sorting.
793793
*/
794-
git_config(git_branch_config, &sorting_options);
794+
repo_config(the_repository, git_branch_config, &sorting_options);
795795
if (!sorting_options.nr)
796796
string_list_append(&sorting_options, "refname");
797797

@@ -987,10 +987,10 @@ int cmd_branch(int argc,
987987

988988
strbuf_reset(&buf);
989989
strbuf_addf(&buf, "branch.%s.remote", branch->name);
990-
git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
990+
repo_config_set_multivar(the_repository, buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
991991
strbuf_reset(&buf);
992992
strbuf_addf(&buf, "branch.%s.merge", branch->name);
993-
git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
993+
repo_config_set_multivar(the_repository, buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
994994
strbuf_release(&buf);
995995
} else if (!noncreate_actions && argc > 0 && argc <= 2) {
996996
const char *branch_name = argv[0];

0 commit comments

Comments
 (0)