Skip to content

Commit 5d3dbc5

Browse files
authored
Merge pull request #4031 from dscho/long-paths-config
Re-design how the `core.longPaths` config setting is read
2 parents d4b9108 + 04a77c9 commit 5d3dbc5

35 files changed

+33
-68
lines changed

builtin/archive.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "parse-options.h"
1010
#include "pkt-line.h"
1111
#include "sideband.h"
12-
#include "config.h"
1312

1413
static void create_output_file(const char *output_file)
1514
{
@@ -94,7 +93,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
9493
OPT_END()
9594
};
9695

97-
git_config(git_default_config, NULL);
9896
argc = parse_options(argc, argv, prefix, local_opts, NULL,
9997
PARSE_OPT_KEEP_ALL);
10098

builtin/bisect--helper.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "prompt.h"
1010
#include "quote.h"
1111
#include "revision.h"
12-
#include "config.h"
1312

1413
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
1514
static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
@@ -1325,7 +1324,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
13251324
};
13261325
struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };
13271326

1328-
git_config(git_default_config, NULL);
13291327
argc = parse_options(argc, argv, prefix, options,
13301328
git_bisect_helper_usage,
13311329
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_UNKNOWN_OPT);

builtin/bundle.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "parse-options.h"
44
#include "cache.h"
55
#include "bundle.h"
6-
#include "config.h"
76

87
/*
98
* Basic handler for bundle files to connect repositories via sneakernet.
@@ -111,7 +110,6 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
111110
};
112111
char *bundle_file;
113112

114-
git_config(git_default_config, NULL);
115113
argc = parse_options_cmd_bundle(argc, argv, prefix,
116114
builtin_bundle_verify_usage, options, &bundle_file);
117115
/* bundle internals use argv[1] as further parameters */

builtin/check-ref-format.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "refs.h"
77
#include "builtin.h"
88
#include "strbuf.h"
9-
#include "config.h"
109

1110
static const char builtin_check_ref_format_usage[] =
1211
"git check-ref-format [--normalize] [<options>] <refname>\n"
@@ -61,7 +60,6 @@ int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
6160
char *to_free = NULL;
6261
int ret = 1;
6362

64-
git_config(git_default_config, NULL);
6563
if (argc == 2 && !strcmp(argv[1], "-h"))
6664
usage(builtin_check_ref_format_usage);
6765

builtin/clone.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
905905
struct transport_ls_refs_options transport_ls_refs_options =
906906
TRANSPORT_LS_REFS_OPTIONS_INIT;
907907

908-
git_config(git_default_core_config, NULL);
909-
910908
packet_trace_identity("clone");
911909

912910
git_config(git_clone_config, NULL);

builtin/column.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ int cmd_column(int argc, const char **argv, const char *prefix)
3434
OPT_END()
3535
};
3636

37-
git_config(git_default_core_config, NULL);
38-
3937
/* This one is special and must be the first one */
4038
if (argc > 1 && starts_with(argv[1], "--command=")) {
4139
command = argv[1] + 10;

builtin/credential-store.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "credential.h"
55
#include "string-list.h"
66
#include "parse-options.h"
7-
#include "config.h"
87

98
static struct lock_file credential_lock;
109

@@ -166,8 +165,6 @@ int cmd_credential_store(int argc, const char **argv, const char *prefix)
166165

167166
umask(077);
168167

169-
git_config(git_default_config, NULL);
170-
171168
argc = parse_options(argc, (const char **)argv, prefix, options, usage, 0);
172169
if (argc != 1)
173170
usage_with_options(usage, options);

builtin/fetch-pack.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "connect.h"
66
#include "oid-array.h"
77
#include "protocol.h"
8-
#include "config.h"
98

109
static const char fetch_pack_usage[] =
1110
"git fetch-pack [--all] [--stdin] [--quiet | -q] [--keep | -k] [--thin] "
@@ -58,7 +57,6 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
5857
struct packet_reader reader;
5958
enum protocol_version version;
6059

61-
git_config(git_default_config, NULL);
6260
fetch_if_missing = 0;
6361

6462
packet_trace_identity("fetch-pack");

builtin/get-tar-commit-id.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "tar.h"
77
#include "builtin.h"
88
#include "quote.h"
9-
#include "config.h"
109

1110
static const char builtin_get_tar_commit_id_usage[] =
1211
"git get-tar-commit-id";
@@ -28,7 +27,6 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)
2827
if (argc != 1)
2928
usage(builtin_get_tar_commit_id_usage);
3029

31-
git_config(git_default_config, NULL);
3230
n = read_in_full(0, buffer, HEADERSIZE);
3331
if (n < 0)
3432
die_errno("git get-tar-commit-id: read error");

builtin/log.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,6 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
24372437
OPT_END()
24382438
};
24392439

2440-
git_config(git_default_config, NULL);
24412440
argc = parse_options(argc, argv, prefix, options, cherry_usage, 0);
24422441

24432442
switch (argc) {

builtin/ls-remote.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "ref-filter.h"
55
#include "remote.h"
66
#include "refs.h"
7-
#include "config.h"
87

98
static const char * const ls_remote_usage[] = {
109
N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
@@ -87,7 +86,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
8786

8887
packet_trace_identity("ls-remote");
8988

90-
git_config(git_default_config, NULL);
9189
if (argc > 1) {
9290
int i;
9391
CALLOC_ARRAY(pattern, argc);

builtin/mailinfo.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "strbuf.h"
99
#include "mailinfo.h"
1010
#include "parse-options.h"
11-
#include "config.h"
1211

1312
static const char * const mailinfo_usage[] = {
1413
/* TRANSLATORS: keep <> in "<" mail ">" info. */
@@ -79,7 +78,6 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
7978
OPT_END()
8079
};
8180

82-
git_config(git_default_config, NULL);
8381
setup_mailinfo(&mi);
8482
meta_charset.policy = CHARSET_DEFAULT;
8583

builtin/mailsplit.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "builtin.h"
99
#include "string-list.h"
1010
#include "strbuf.h"
11-
#include "config.h"
1211

1312
static const char git_mailsplit_usage[] =
1413
"git mailsplit [-d<prec>] [-f<n>] [-b] [--keep-cr] -o<directory> [(<mbox>|<Maildir>)...]";
@@ -278,7 +277,6 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
278277
const char **argp;
279278
static const char *stdin_only[] = { "-", NULL };
280279

281-
git_config(git_default_config, NULL);
282280
for (argp = argv+1; *argp; argp++) {
283281
const char *arg = *argp;
284282

builtin/merge-index.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define USE_THE_INDEX_COMPATIBILITY_MACROS
22
#include "builtin.h"
33
#include "run-command.h"
4-
#include "config.h"
54

65
static const char *pgm;
76
static int one_shot, quiet;
@@ -78,8 +77,6 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix)
7877
*/
7978
signal(SIGCHLD, SIG_DFL);
8079

81-
git_config(git_default_config, NULL);
82-
8380
if (argc < 3)
8481
usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");
8582

builtin/merge-tree.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "exec-cmd.h"
1313
#include "merge-blobs.h"
1414
#include "quote.h"
15-
#include "config.h"
1615

1716
static int line_termination = '\n';
1817

@@ -509,8 +508,6 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
509508
OPT_END()
510509
};
511510

512-
git_config(git_default_config, NULL);
513-
514511
/* Parse arguments */
515512
original_argc = argc - 1; /* ignoring argv[0] */
516513
argc = parse_options(argc, argv, prefix, mt_options,

builtin/mktag.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
8484
builtin_mktag_options,
8585
builtin_mktag_usage, 0);
8686

87-
git_config(git_default_config, NULL);
8887
if (strbuf_read(&buf, 0, 0) < 0)
8988
die_errno(_("could not read from stdin"));
9089

builtin/mktree.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "tree.h"
99
#include "parse-options.h"
1010
#include "object-store.h"
11-
#include "config.h"
1211

1312
static struct treeent {
1413
unsigned mode;
@@ -165,7 +164,6 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
165164
OPT_END()
166165
};
167166

168-
git_config(git_default_config, NULL);
169167
ac = parse_options(ac, av, prefix, option, mktree_usage, 0);
170168
getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;
171169

builtin/pack-refs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "parse-options.h"
44
#include "refs.h"
55
#include "repository.h"
6-
#include "config.h"
76

87
static char const * const pack_refs_usage[] = {
98
N_("git pack-refs [<options>]"),

builtin/prune-packed.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "builtin.h"
22
#include "parse-options.h"
33
#include "prune-packed.h"
4-
#include "config.h"
54

65
static const char * const prune_packed_usage[] = {
76
"git prune-packed [-n | --dry-run] [-q | --quiet]",
@@ -19,7 +18,6 @@ int cmd_prune_packed(int argc, const char **argv, const char *prefix)
1918
OPT_END()
2019
};
2120

22-
git_config(git_default_config, NULL);
2321
argc = parse_options(argc, argv, prefix, prune_packed_options,
2422
prune_packed_usage, 0);
2523

builtin/prune.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "prune-packed.h"
1010
#include "object-store.h"
1111
#include "shallow.h"
12-
#include "config.h"
1312

1413
static const char * const prune_usage[] = {
1514
N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
@@ -153,8 +152,6 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
153152
};
154153
char *s;
155154

156-
git_config(git_default_config, NULL);
157-
158155
expire = TIME_MAX;
159156
save_commit_buffer = 0;
160157
read_replace_refs = 0;

builtin/reflog.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ int cmd_reflog(int argc, const char **argv, const char *prefix)
418418
OPT_END()
419419
};
420420

421-
git_config(git_default_config, NULL);
422421
argc = parse_options(argc, argv, prefix, options, reflog_usage,
423422
PARSE_OPT_SUBCOMMAND_OPTIONAL |
424423
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_ARGV0 |

builtin/remote-ext.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "transport.h"
33
#include "run-command.h"
44
#include "pkt-line.h"
5-
#include "config.h"
65

76
static const char usage_msg[] =
87
"git remote-ext <remote> <url>";
@@ -199,6 +198,5 @@ int cmd_remote_ext(int argc, const char **argv, const char *prefix)
199198
if (argc != 3)
200199
usage(usage_msg);
201200

202-
git_config(git_default_config, NULL);
203201
return command_loop(argv[2]);
204202
}

builtin/remote.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,6 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
17651765
OPT_END()
17661766
};
17671767

1768-
git_config(git_default_config, NULL);
17691768
argc = parse_options(argc, argv, prefix, options, builtin_remote_usage,
17701769
PARSE_OPT_SUBCOMMAND_OPTIONAL);
17711770

builtin/rev-parse.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
428428
struct option *opts = NULL;
429429
int onb = 0, osz = 0, unb = 0, usz = 0;
430430

431-
git_config(git_default_config, NULL);
432431
strbuf_addstr(&parsed, "set --");
433432
argc = parse_options(argc, argv, prefix, parseopt_opts, parseopt_usage,
434433
PARSE_OPT_KEEP_DASHDASH);

builtin/show-index.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "cache.h"
33
#include "pack.h"
44
#include "parse-options.h"
5-
#include "config.h"
65

76
static const char *const show_index_usage[] = {
87
"git show-index [--object-format=<hash-algorithm>]",
@@ -24,7 +23,6 @@ int cmd_show_index(int argc, const char **argv, const char *prefix)
2423
OPT_END()
2524
};
2625

27-
git_config(git_default_config, NULL);
2826
argc = parse_options(argc, argv, prefix, show_index_options, show_index_usage, 0);
2927

3028
if (hash_name) {

builtin/show-ref.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "tag.h"
88
#include "string-list.h"
99
#include "parse-options.h"
10-
#include "config.h"
1110

1211
static const char * const show_ref_usage[] = {
1312
N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"),

builtin/stripspace.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
4646
if (argc)
4747
usage_with_options(stripspace_usage, options);
4848

49-
if (mode == STRIP_COMMENTS || mode == COMMENT_LINES)
49+
if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
5050
setup_git_directory_gently(&nongit);
51-
git_config(git_default_config, NULL);
51+
git_config(git_default_config, NULL);
52+
}
5253

5354
if (strbuf_read(&buf, 0, 1024) < 0)
5455
die_errno("could not read the input");

builtin/submodule--helper.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3425,7 +3425,6 @@ static struct cmd_struct commands[] = {
34253425
int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
34263426
{
34273427
int i;
3428-
git_config(git_default_config, NULL);
34293428
if (argc < 2 || !strcmp(argv[1], "-h"))
34303429
usage("git submodule--helper <command>");
34313430

builtin/upload-archive.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "sideband.h"
99
#include "run-command.h"
1010
#include "strvec.h"
11-
#include "config.h"
1211

1312
static const char upload_archive_usage[] =
1413
"git upload-archive <repo>";
@@ -29,7 +28,6 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
2928
if (!enter_repo(argv[1], 0))
3029
die("'%s' does not appear to be a git repository", argv[1]);
3130

32-
git_config(git_default_config, NULL);
3331
init_archivers();
3432

3533
/* put received options in sent_argv[] */
@@ -81,7 +79,6 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
8179
{
8280
struct child_process writer = CHILD_PROCESS_INIT;
8381

84-
git_config(git_default_config, NULL);
8582
if (argc == 2 && !strcmp(argv[1], "-h"))
8683
usage(upload_archive_usage);
8784

0 commit comments

Comments
 (0)