fixup! mingw: ensure that core.longPaths is handled *always*

This is no longer necessary (and was fragile to begin with, as many code
paths might have been missed).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2022-09-17 14:57:27 +02:00
Родитель 70b5348b57
Коммит 04a77c905d
31 изменённых файлов: 4 добавлений и 57 удалений

Просмотреть файл

@ -9,7 +9,6 @@
#include "parse-options.h"
#include "pkt-line.h"
#include "sideband.h"
#include "config.h"
static void create_output_file(const char *output_file)
{
@ -94,7 +93,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, local_opts, NULL,
PARSE_OPT_KEEP_ALL);

Просмотреть файл

@ -9,7 +9,6 @@
#include "prompt.h"
#include "quote.h"
#include "revision.h"
#include "config.h"
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
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)
};
struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options,
git_bisect_helper_usage,
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_UNKNOWN_OPT);

Просмотреть файл

@ -3,7 +3,6 @@
#include "parse-options.h"
#include "cache.h"
#include "bundle.h"
#include "config.h"
/*
* 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) {
};
char *bundle_file;
git_config(git_default_config, NULL);
argc = parse_options_cmd_bundle(argc, argv, prefix,
builtin_bundle_verify_usage, options, &bundle_file);
/* bundle internals use argv[1] as further parameters */

Просмотреть файл

@ -6,7 +6,6 @@
#include "refs.h"
#include "builtin.h"
#include "strbuf.h"
#include "config.h"
static const char builtin_check_ref_format_usage[] =
"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)
char *to_free = NULL;
int ret = 1;
git_config(git_default_config, NULL);
if (argc == 2 && !strcmp(argv[1], "-h"))
usage(builtin_check_ref_format_usage);

Просмотреть файл

@ -905,8 +905,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
struct transport_ls_refs_options transport_ls_refs_options =
TRANSPORT_LS_REFS_OPTIONS_INIT;
git_config(git_default_core_config, NULL);
packet_trace_identity("clone");
git_config(git_clone_config, NULL);

Просмотреть файл

@ -34,8 +34,6 @@ int cmd_column(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_core_config, NULL);
/* This one is special and must be the first one */
if (argc > 1 && starts_with(argv[1], "--command=")) {
command = argv[1] + 10;

Просмотреть файл

@ -4,7 +4,6 @@
#include "credential.h"
#include "string-list.h"
#include "parse-options.h"
#include "config.h"
static struct lock_file credential_lock;
@ -166,8 +165,6 @@ int cmd_credential_store(int argc, const char **argv, const char *prefix)
umask(077);
git_config(git_default_config, NULL);
argc = parse_options(argc, (const char **)argv, prefix, options, usage, 0);
if (argc != 1)
usage_with_options(usage, options);

Просмотреть файл

@ -5,7 +5,6 @@
#include "connect.h"
#include "oid-array.h"
#include "protocol.h"
#include "config.h"
static const char fetch_pack_usage[] =
"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)
struct packet_reader reader;
enum protocol_version version;
git_config(git_default_config, NULL);
fetch_if_missing = 0;
packet_trace_identity("fetch-pack");

Просмотреть файл

@ -6,7 +6,6 @@
#include "tar.h"
#include "builtin.h"
#include "quote.h"
#include "config.h"
static const char builtin_get_tar_commit_id_usage[] =
"git get-tar-commit-id";
@ -28,7 +27,6 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)
if (argc != 1)
usage(builtin_get_tar_commit_id_usage);
git_config(git_default_config, NULL);
n = read_in_full(0, buffer, HEADERSIZE);
if (n < 0)
die_errno("git get-tar-commit-id: read error");

Просмотреть файл

@ -2437,7 +2437,6 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, cherry_usage, 0);
switch (argc) {

Просмотреть файл

@ -4,7 +4,6 @@
#include "ref-filter.h"
#include "remote.h"
#include "refs.h"
#include "config.h"
static const char * const ls_remote_usage[] = {
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)
packet_trace_identity("ls-remote");
git_config(git_default_config, NULL);
if (argc > 1) {
int i;
CALLOC_ARRAY(pattern, argc);

Просмотреть файл

@ -8,7 +8,6 @@
#include "strbuf.h"
#include "mailinfo.h"
#include "parse-options.h"
#include "config.h"
static const char * const mailinfo_usage[] = {
/* TRANSLATORS: keep <> in "<" mail ">" info. */
@ -79,7 +78,6 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
setup_mailinfo(&mi);
meta_charset.policy = CHARSET_DEFAULT;

Просмотреть файл

@ -8,7 +8,6 @@
#include "builtin.h"
#include "string-list.h"
#include "strbuf.h"
#include "config.h"
static const char git_mailsplit_usage[] =
"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)
const char **argp;
static const char *stdin_only[] = { "-", NULL };
git_config(git_default_config, NULL);
for (argp = argv+1; *argp; argp++) {
const char *arg = *argp;

Просмотреть файл

@ -1,7 +1,6 @@
#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "builtin.h"
#include "run-command.h"
#include "config.h"
static const char *pgm;
static int one_shot, quiet;
@ -78,8 +77,6 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix)
*/
signal(SIGCHLD, SIG_DFL);
git_config(git_default_config, NULL);
if (argc < 3)
usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");

Просмотреть файл

@ -12,7 +12,6 @@
#include "exec-cmd.h"
#include "merge-blobs.h"
#include "quote.h"
#include "config.h"
static int line_termination = '\n';
@ -509,8 +508,6 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
/* Parse arguments */
original_argc = argc - 1; /* ignoring argv[0] */
argc = parse_options(argc, argv, prefix, mt_options,

Просмотреть файл

@ -84,7 +84,6 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
builtin_mktag_options,
builtin_mktag_usage, 0);
git_config(git_default_config, NULL);
if (strbuf_read(&buf, 0, 0) < 0)
die_errno(_("could not read from stdin"));

Просмотреть файл

@ -8,7 +8,6 @@
#include "tree.h"
#include "parse-options.h"
#include "object-store.h"
#include "config.h"
static struct treeent {
unsigned mode;
@ -165,7 +164,6 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
ac = parse_options(ac, av, prefix, option, mktree_usage, 0);
getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;

Просмотреть файл

@ -3,7 +3,6 @@
#include "parse-options.h"
#include "refs.h"
#include "repository.h"
#include "config.h"
static char const * const pack_refs_usage[] = {
N_("git pack-refs [<options>]"),

Просмотреть файл

@ -1,7 +1,6 @@
#include "builtin.h"
#include "parse-options.h"
#include "prune-packed.h"
#include "config.h"
static const char * const prune_packed_usage[] = {
"git prune-packed [-n | --dry-run] [-q | --quiet]",
@ -19,7 +18,6 @@ int cmd_prune_packed(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, prune_packed_options,
prune_packed_usage, 0);

Просмотреть файл

@ -9,7 +9,6 @@
#include "prune-packed.h"
#include "object-store.h"
#include "shallow.h"
#include "config.h"
static const char * const prune_usage[] = {
N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
@ -153,8 +152,6 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
};
char *s;
git_config(git_default_config, NULL);
expire = TIME_MAX;
save_commit_buffer = 0;
read_replace_refs = 0;

Просмотреть файл

@ -418,7 +418,6 @@ int cmd_reflog(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, reflog_usage,
PARSE_OPT_SUBCOMMAND_OPTIONAL |
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_ARGV0 |

Просмотреть файл

@ -2,7 +2,6 @@
#include "transport.h"
#include "run-command.h"
#include "pkt-line.h"
#include "config.h"
static const char usage_msg[] =
"git remote-ext <remote> <url>";
@ -199,6 +198,5 @@ int cmd_remote_ext(int argc, const char **argv, const char *prefix)
if (argc != 3)
usage(usage_msg);
git_config(git_default_config, NULL);
return command_loop(argv[2]);
}

Просмотреть файл

@ -1765,7 +1765,6 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, builtin_remote_usage,
PARSE_OPT_SUBCOMMAND_OPTIONAL);

Просмотреть файл

@ -428,7 +428,6 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
struct option *opts = NULL;
int onb = 0, osz = 0, unb = 0, usz = 0;
git_config(git_default_config, NULL);
strbuf_addstr(&parsed, "set --");
argc = parse_options(argc, argv, prefix, parseopt_opts, parseopt_usage,
PARSE_OPT_KEEP_DASHDASH);

Просмотреть файл

@ -2,7 +2,6 @@
#include "cache.h"
#include "pack.h"
#include "parse-options.h"
#include "config.h"
static const char *const show_index_usage[] = {
"git show-index [--object-format=<hash-algorithm>]",
@ -24,7 +23,6 @@ int cmd_show_index(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, show_index_options, show_index_usage, 0);
if (hash_name) {

Просмотреть файл

@ -7,7 +7,6 @@
#include "tag.h"
#include "string-list.h"
#include "parse-options.h"
#include "config.h"
static const char * const show_ref_usage[] = {
N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"),

Просмотреть файл

@ -46,9 +46,10 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
if (argc)
usage_with_options(stripspace_usage, options);
if (mode == STRIP_COMMENTS || mode == COMMENT_LINES)
if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
setup_git_directory_gently(&nongit);
git_config(git_default_config, NULL);
git_config(git_default_config, NULL);
}
if (strbuf_read(&buf, 0, 1024) < 0)
die_errno("could not read the input");

Просмотреть файл

@ -3425,7 +3425,6 @@ static struct cmd_struct commands[] = {
int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
{
int i;
git_config(git_default_config, NULL);
if (argc < 2 || !strcmp(argv[1], "-h"))
usage("git submodule--helper <command>");

Просмотреть файл

@ -8,7 +8,6 @@
#include "sideband.h"
#include "run-command.h"
#include "strvec.h"
#include "config.h"
static const char upload_archive_usage[] =
"git upload-archive <repo>";
@ -29,7 +28,6 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
if (!enter_repo(argv[1], 0))
die("'%s' does not appear to be a git repository", argv[1]);
git_config(git_default_config, NULL);
init_archivers();
/* put received options in sent_argv[] */
@ -81,7 +79,6 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
{
struct child_process writer = CHILD_PROCESS_INIT;
git_config(git_default_config, NULL);
if (argc == 2 && !strcmp(argv[1], "-h"))
usage(upload_archive_usage);

Просмотреть файл

@ -783,7 +783,6 @@ int cmd_main(int argc, const char **argv)
setup_path();
if (!enter_repo(dir, 0))
not_found(&hdr, "Not a git repository: '%s'", dir);
git_config(git_default_config, NULL);
if (!getenv("GIT_HTTP_EXPORT_ALL") &&
access("git-daemon-export-ok", F_OK) )
not_found(&hdr, "Repository not exported: '%s'", dir);

2
refs.c
Просмотреть файл

@ -1411,7 +1411,7 @@ int parse_hide_refs_config(const char *var, const char *value, const char *secti
}
string_list_append(hide_refs, ref);
}
return git_default_config(var, value, NULL);
return 0;
}
int ref_is_hidden(const char *refname, const char *refname_full)