зеркало из https://github.com/microsoft/git.git
mingw: ensure that core.longPaths is handled *always*
A ton of Git commands simply do not read (or at least parse) the core.* settings. This is not good, as Git for Windows relies on the core.longPaths setting to be read quite early on. So let's just make sure that all commands read the config and give platform_core_config() a chance. This patch teaches tons of Git commands to respect the config setting `core.longPaths = true`, including `pack-refs`, thereby fixing https://github.com/git-for-windows/git/issues/1218 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Родитель
03e16328d3
Коммит
940ec350fa
|
@ -9,6 +9,7 @@
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
#include "pkt-line.h"
|
#include "pkt-line.h"
|
||||||
#include "sideband.h"
|
#include "sideband.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static void create_output_file(const char *output_file)
|
static void create_output_file(const char *output_file)
|
||||||
{
|
{
|
||||||
|
@ -94,6 +95,7 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
argc = parse_options(argc, argv, prefix, local_opts, NULL,
|
argc = parse_options(argc, argv, prefix, local_opts, NULL,
|
||||||
PARSE_OPT_KEEP_ALL);
|
PARSE_OPT_KEEP_ALL);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
#include "bisect.h"
|
#include "bisect.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
|
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
|
||||||
static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
|
static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
|
||||||
|
@ -129,6 +130,7 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
argc = parse_options(argc, argv, prefix, options,
|
argc = parse_options(argc, argv, prefix, options,
|
||||||
git_bisect_helper_usage, 0);
|
git_bisect_helper_usage, 0);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "bundle.h"
|
#include "bundle.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Basic handler for bundle files to connect repositories via sneakernet.
|
* Basic handler for bundle files to connect repositories via sneakernet.
|
||||||
|
@ -21,6 +22,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
|
||||||
const char *cmd, *bundle_file;
|
const char *cmd, *bundle_file;
|
||||||
int bundle_fd = -1;
|
int bundle_fd = -1;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
usage(builtin_bundle_usage);
|
usage(builtin_bundle_usage);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "strbuf.h"
|
#include "strbuf.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char builtin_check_ref_format_usage[] =
|
static const char builtin_check_ref_format_usage[] =
|
||||||
"git check-ref-format [--normalize] [<options>] <refname>\n"
|
"git check-ref-format [--normalize] [<options>] <refname>\n"
|
||||||
|
@ -58,6 +59,7 @@ int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
const char *refname;
|
const char *refname;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (argc == 2 && !strcmp(argv[1], "-h"))
|
if (argc == 2 && !strcmp(argv[1], "-h"))
|
||||||
usage(builtin_check_ref_format_usage);
|
usage(builtin_check_ref_format_usage);
|
||||||
|
|
||||||
|
|
|
@ -901,6 +901,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
||||||
struct refspec rs = REFSPEC_INIT_FETCH;
|
struct refspec rs = REFSPEC_INIT_FETCH;
|
||||||
struct argv_array ref_prefixes = ARGV_ARRAY_INIT;
|
struct argv_array ref_prefixes = ARGV_ARRAY_INIT;
|
||||||
|
|
||||||
|
git_config(platform_core_config, NULL);
|
||||||
fetch_if_missing = 0;
|
fetch_if_missing = 0;
|
||||||
|
|
||||||
packet_trace_identity("clone");
|
packet_trace_identity("clone");
|
||||||
|
|
|
@ -34,6 +34,8 @@ int cmd_column(int argc, const char **argv, const char *prefix)
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git_config(platform_core_config, NULL);
|
||||||
|
|
||||||
/* This one is special and must be the first one */
|
/* This one is special and must be the first one */
|
||||||
if (argc > 1 && starts_with(argv[1], "--command=")) {
|
if (argc > 1 && starts_with(argv[1], "--command=")) {
|
||||||
command = argv[1] + 10;
|
command = argv[1] + 10;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "git-compat-util.h"
|
#include "git-compat-util.h"
|
||||||
#include "credential.h"
|
#include "credential.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char usage_msg[] =
|
static const char usage_msg[] =
|
||||||
"git credential [fill|approve|reject]";
|
"git credential [fill|approve|reject]";
|
||||||
|
@ -10,6 +11,8 @@ int cmd_credential(int argc, const char **argv, const char *prefix)
|
||||||
const char *op;
|
const char *op;
|
||||||
struct credential c = CREDENTIAL_INIT;
|
struct credential c = CREDENTIAL_INIT;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
|
|
||||||
if (argc != 2 || !strcmp(argv[1], "-h"))
|
if (argc != 2 || !strcmp(argv[1], "-h"))
|
||||||
usage(usage_msg);
|
usage(usage_msg);
|
||||||
op = argv[1];
|
op = argv[1];
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "sha1-array.h"
|
#include "sha1-array.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char fetch_pack_usage[] =
|
static const char fetch_pack_usage[] =
|
||||||
"git fetch-pack [--all] [--stdin] [--quiet | -q] [--keep | -k] [--thin] "
|
"git fetch-pack [--all] [--stdin] [--quiet | -q] [--keep | -k] [--thin] "
|
||||||
|
@ -56,6 +57,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
|
||||||
struct string_list deepen_not = STRING_LIST_INIT_DUP;
|
struct string_list deepen_not = STRING_LIST_INIT_DUP;
|
||||||
struct packet_reader reader;
|
struct packet_reader reader;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
fetch_if_missing = 0;
|
fetch_if_missing = 0;
|
||||||
|
|
||||||
packet_trace_identity("fetch-pack");
|
packet_trace_identity("fetch-pack");
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "tar.h"
|
#include "tar.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char builtin_get_tar_commit_id_usage[] =
|
static const char builtin_get_tar_commit_id_usage[] =
|
||||||
"git get-tar-commit-id";
|
"git get-tar-commit-id";
|
||||||
|
@ -25,6 +26,7 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage(builtin_get_tar_commit_id_usage);
|
usage(builtin_get_tar_commit_id_usage);
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
n = read_in_full(0, buffer, HEADERSIZE);
|
n = read_in_full(0, buffer, HEADERSIZE);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
die_errno("git get-tar-commit-id: read error");
|
die_errno("git get-tar-commit-id: read error");
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
#include "string-list.h"
|
#include "string-list.h"
|
||||||
#include "trailer.h"
|
#include "trailer.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char * const git_interpret_trailers_usage[] = {
|
static const char * const git_interpret_trailers_usage[] = {
|
||||||
N_("git interpret-trailers [--in-place] [--trim-empty] [(--trailer <token>[(=|:)<value>])...] [<file>...]"),
|
N_("git interpret-trailers [--in-place] [--trim-empty] [(--trailer <token>[(=|:)<value>])...] [<file>...]"),
|
||||||
|
@ -112,6 +113,7 @@ int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
argc = parse_options(argc, argv, prefix, options,
|
argc = parse_options(argc, argv, prefix, options,
|
||||||
git_interpret_trailers_usage, 0);
|
git_interpret_trailers_usage, 0);
|
||||||
|
|
||||||
|
|
|
@ -2033,6 +2033,7 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
argc = parse_options(argc, argv, prefix, options, cherry_usage, 0);
|
argc = parse_options(argc, argv, prefix, options, cherry_usage, 0);
|
||||||
|
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "ref-filter.h"
|
#include "ref-filter.h"
|
||||||
#include "remote.h"
|
#include "remote.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char * const ls_remote_usage[] = {
|
static const char * const ls_remote_usage[] = {
|
||||||
N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
|
N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
|
||||||
|
@ -84,6 +85,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
|
||||||
PARSE_OPT_STOP_AT_NON_OPTION);
|
PARSE_OPT_STOP_AT_NON_OPTION);
|
||||||
dest = argv[0];
|
dest = argv[0];
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
int i;
|
int i;
|
||||||
pattern = xcalloc(argc, sizeof(const char *));
|
pattern = xcalloc(argc, sizeof(const char *));
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "utf8.h"
|
#include "utf8.h"
|
||||||
#include "strbuf.h"
|
#include "strbuf.h"
|
||||||
#include "mailinfo.h"
|
#include "mailinfo.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char mailinfo_usage[] =
|
static const char mailinfo_usage[] =
|
||||||
"git mailinfo [-k | -b] [-m | --message-id] [-u | --encoding=<encoding> | -n] [--scissors | --no-scissors] <msg> <patch> < mail >info";
|
"git mailinfo [-k | -b] [-m | --message-id] [-u | --encoding=<encoding> | -n] [--scissors | --no-scissors] <msg> <patch> < mail >info";
|
||||||
|
@ -18,6 +19,7 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
|
||||||
int status;
|
int status;
|
||||||
char *msgfile, *patchfile;
|
char *msgfile, *patchfile;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
setup_mailinfo(&mi);
|
setup_mailinfo(&mi);
|
||||||
|
|
||||||
def_charset = get_commit_output_encoding();
|
def_charset = get_commit_output_encoding();
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "string-list.h"
|
#include "string-list.h"
|
||||||
#include "strbuf.h"
|
#include "strbuf.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char git_mailsplit_usage[] =
|
static const char git_mailsplit_usage[] =
|
||||||
"git mailsplit [-d<prec>] [-f<n>] [-b] [--keep-cr] -o<directory> [(<mbox>|<Maildir>)...]";
|
"git mailsplit [-d<prec>] [-f<n>] [-b] [--keep-cr] -o<directory> [(<mbox>|<Maildir>)...]";
|
||||||
|
@ -276,6 +277,7 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
|
||||||
const char **argp;
|
const char **argp;
|
||||||
static const char *stdin_only[] = { "-", NULL };
|
static const char *stdin_only[] = { "-", NULL };
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
for (argp = argv+1; *argp; argp++) {
|
for (argp = argv+1; *argp; argp++) {
|
||||||
const char *arg = *argp;
|
const char *arg = *argp;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char *pgm;
|
static const char *pgm;
|
||||||
static int one_shot, quiet;
|
static int one_shot, quiet;
|
||||||
|
@ -74,6 +75,8 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix)
|
||||||
*/
|
*/
|
||||||
signal(SIGCHLD, SIG_DFL);
|
signal(SIGCHLD, SIG_DFL);
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
|
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");
|
usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "blob.h"
|
#include "blob.h"
|
||||||
#include "exec-cmd.h"
|
#include "exec-cmd.h"
|
||||||
#include "merge-blobs.h"
|
#include "merge-blobs.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
|
static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
|
||||||
|
|
||||||
|
@ -370,6 +371,7 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
|
||||||
if (argc != 4)
|
if (argc != 4)
|
||||||
usage(merge_tree_usage);
|
usage(merge_tree_usage);
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
buf1 = get_tree_descriptor(t+0, argv[1]);
|
buf1 = get_tree_descriptor(t+0, argv[1]);
|
||||||
buf2 = get_tree_descriptor(t+1, argv[2]);
|
buf2 = get_tree_descriptor(t+1, argv[2]);
|
||||||
buf3 = get_tree_descriptor(t+2, argv[3]);
|
buf3 = get_tree_descriptor(t+2, argv[3]);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "replace-object.h"
|
#include "replace-object.h"
|
||||||
#include "object-store.h"
|
#include "object-store.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A signature file has a very simple fixed format: four lines
|
* A signature file has a very simple fixed format: four lines
|
||||||
|
@ -158,6 +159,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage("git mktag");
|
usage("git mktag");
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (strbuf_read(&buf, 0, 4096) < 0) {
|
if (strbuf_read(&buf, 0, 4096) < 0) {
|
||||||
die_errno("could not read from stdin");
|
die_errno("could not read from stdin");
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
#include "object-store.h"
|
#include "object-store.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static struct treeent {
|
static struct treeent {
|
||||||
unsigned mode;
|
unsigned mode;
|
||||||
|
@ -157,6 +158,7 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
ac = parse_options(ac, av, prefix, option, mktree_usage, 0);
|
ac = parse_options(ac, av, prefix, option, mktree_usage, 0);
|
||||||
getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;
|
getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include "repository.h"
|
#include "repository.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static char const * const pack_refs_usage[] = {
|
static char const * const pack_refs_usage[] = {
|
||||||
N_("git pack-refs [<options>]"),
|
N_("git pack-refs [<options>]"),
|
||||||
|
@ -16,6 +17,7 @@ int cmd_pack_refs(int argc, const char **argv, const char *prefix)
|
||||||
OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
|
OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
|
||||||
OPT_END(),
|
OPT_END(),
|
||||||
};
|
};
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
|
if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
|
||||||
usage_with_options(pack_refs_usage, opts);
|
usage_with_options(pack_refs_usage, opts);
|
||||||
return refs_pack_refs(get_main_ref_store(the_repository), flags);
|
return refs_pack_refs(get_main_ref_store(the_repository), flags);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
#include "packfile.h"
|
#include "packfile.h"
|
||||||
#include "object-store.h"
|
#include "object-store.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char * const prune_packed_usage[] = {
|
static const char * const prune_packed_usage[] = {
|
||||||
N_("git prune-packed [-n | --dry-run] [-q | --quiet]"),
|
N_("git prune-packed [-n | --dry-run] [-q | --quiet]"),
|
||||||
|
@ -60,6 +61,7 @@ int cmd_prune_packed(int argc, const char **argv, const char *prefix)
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
argc = parse_options(argc, argv, prefix, prune_packed_options,
|
argc = parse_options(argc, argv, prefix, prune_packed_options,
|
||||||
prune_packed_usage, 0);
|
prune_packed_usage, 0);
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
#include "object-store.h"
|
#include "object-store.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char * const prune_usage[] = {
|
static const char * const prune_usage[] = {
|
||||||
N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
|
N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
|
||||||
|
@ -116,6 +117,8 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
|
||||||
};
|
};
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
|
|
||||||
expire = TIME_MAX;
|
expire = TIME_MAX;
|
||||||
save_commit_buffer = 0;
|
save_commit_buffer = 0;
|
||||||
read_replace_refs = 0;
|
read_replace_refs = 0;
|
||||||
|
|
|
@ -761,6 +761,7 @@ static const char reflog_usage[] =
|
||||||
|
|
||||||
int cmd_reflog(int argc, const char **argv, const char *prefix)
|
int cmd_reflog(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (argc > 1 && !strcmp(argv[1], "-h"))
|
if (argc > 1 && !strcmp(argv[1], "-h"))
|
||||||
usage(reflog_usage);
|
usage(reflog_usage);
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "transport.h"
|
#include "transport.h"
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
#include "pkt-line.h"
|
#include "pkt-line.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char usage_msg[] =
|
static const char usage_msg[] =
|
||||||
"git remote-ext <remote> <url>";
|
"git remote-ext <remote> <url>";
|
||||||
|
@ -198,5 +199,6 @@ int cmd_remote_ext(int argc, const char **argv, const char *prefix)
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
usage(usage_msg);
|
usage(usage_msg);
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
return command_loop(argv[2]);
|
return command_loop(argv[2]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1612,6 +1612,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
|
||||||
};
|
};
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
argc = parse_options(argc, argv, prefix, options, builtin_remote_usage,
|
argc = parse_options(argc, argv, prefix, options, builtin_remote_usage,
|
||||||
PARSE_OPT_STOP_AT_NON_OPTION);
|
PARSE_OPT_STOP_AT_NON_OPTION);
|
||||||
|
|
||||||
|
|
|
@ -424,6 +424,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
|
||||||
struct option *opts = NULL;
|
struct option *opts = NULL;
|
||||||
int onb = 0, osz = 0, unb = 0, usz = 0;
|
int onb = 0, osz = 0, unb = 0, usz = 0;
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
strbuf_addstr(&parsed, "set --");
|
strbuf_addstr(&parsed, "set --");
|
||||||
argc = parse_options(argc, argv, prefix, parseopt_opts, parseopt_usage,
|
argc = parse_options(argc, argv, prefix, parseopt_opts, parseopt_usage,
|
||||||
PARSE_OPT_KEEP_DASHDASH);
|
PARSE_OPT_KEEP_DASHDASH);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char show_index_usage[] =
|
static const char show_index_usage[] =
|
||||||
"git show-index";
|
"git show-index";
|
||||||
|
@ -14,6 +15,7 @@ int cmd_show_index(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage(show_index_usage);
|
usage(show_index_usage);
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (fread(top_index, 2 * 4, 1, stdin) != 1)
|
if (fread(top_index, 2 * 4, 1, stdin) != 1)
|
||||||
die("unable to read header");
|
die("unable to read header");
|
||||||
if (top_index[0] == htonl(PACK_IDX_SIGNATURE)) {
|
if (top_index[0] == htonl(PACK_IDX_SIGNATURE)) {
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "string-list.h"
|
#include "string-list.h"
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char * const show_ref_usage[] = {
|
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>...]"),
|
N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"),
|
||||||
|
@ -182,6 +183,7 @@ static const struct option show_ref_options[] = {
|
||||||
|
|
||||||
int cmd_show_ref(int argc, const char **argv, const char *prefix)
|
int cmd_show_ref(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
argc = parse_options(argc, argv, prefix, show_ref_options,
|
argc = parse_options(argc, argv, prefix, show_ref_options,
|
||||||
show_ref_usage, 0);
|
show_ref_usage, 0);
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,9 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
|
||||||
if (argc)
|
if (argc)
|
||||||
usage_with_options(stripspace_usage, options);
|
usage_with_options(stripspace_usage, options);
|
||||||
|
|
||||||
if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
|
if (mode == STRIP_COMMENTS || mode == COMMENT_LINES)
|
||||||
setup_git_directory_gently(NULL);
|
setup_git_directory_gently(NULL);
|
||||||
git_config(git_default_config, NULL);
|
git_config(git_default_config, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
if (strbuf_read(&buf, 0, 1024) < 0)
|
if (strbuf_read(&buf, 0, 1024) < 0)
|
||||||
die_errno("could not read the input");
|
die_errno("could not read the input");
|
||||||
|
|
|
@ -2215,6 +2215,7 @@ static struct cmd_struct commands[] = {
|
||||||
int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
|
int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (argc < 2 || !strcmp(argv[1], "-h"))
|
if (argc < 2 || !strcmp(argv[1], "-h"))
|
||||||
usage("git submodule--helper <command>");
|
usage("git submodule--helper <command>");
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "sideband.h"
|
#include "sideband.h"
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
#include "argv-array.h"
|
#include "argv-array.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static const char upload_archive_usage[] =
|
static const char upload_archive_usage[] =
|
||||||
"git upload-archive <repo>";
|
"git upload-archive <repo>";
|
||||||
|
@ -28,6 +29,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
|
||||||
if (!enter_repo(argv[1], 0))
|
if (!enter_repo(argv[1], 0))
|
||||||
die("'%s' does not appear to be a git repository", argv[1]);
|
die("'%s' does not appear to be a git repository", argv[1]);
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
init_archivers();
|
init_archivers();
|
||||||
|
|
||||||
/* put received options in sent_argv[] */
|
/* put received options in sent_argv[] */
|
||||||
|
@ -79,6 +81,7 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
struct child_process writer = { argv };
|
struct child_process writer = { argv };
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (argc == 2 && !strcmp(argv[1], "-h"))
|
if (argc == 2 && !strcmp(argv[1], "-h"))
|
||||||
usage(upload_archive_usage);
|
usage(upload_archive_usage);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "credential.h"
|
#include "credential.h"
|
||||||
#include "string-list.h"
|
#include "string-list.h"
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static struct lock_file credential_lock;
|
static struct lock_file credential_lock;
|
||||||
|
|
||||||
|
@ -160,6 +161,8 @@ int cmd_main(int argc, const char **argv)
|
||||||
|
|
||||||
umask(077);
|
umask(077);
|
||||||
|
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
|
|
||||||
argc = parse_options(argc, (const char **)argv, NULL, options, usage, 0);
|
argc = parse_options(argc, (const char **)argv, NULL, options, usage, 0);
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage_with_options(usage, options);
|
usage_with_options(usage, options);
|
||||||
|
|
|
@ -777,6 +777,7 @@ int cmd_main(int argc, const char **argv)
|
||||||
setup_path();
|
setup_path();
|
||||||
if (!enter_repo(dir, 0))
|
if (!enter_repo(dir, 0))
|
||||||
not_found(&hdr, "Not a git repository: '%s'", dir);
|
not_found(&hdr, "Not a git repository: '%s'", dir);
|
||||||
|
git_config(git_default_config, NULL);
|
||||||
if (!getenv("GIT_HTTP_EXPORT_ALL") &&
|
if (!getenv("GIT_HTTP_EXPORT_ALL") &&
|
||||||
access("git-daemon-export-ok", F_OK) )
|
access("git-daemon-export-ok", F_OK) )
|
||||||
not_found(&hdr, "Repository not exported: '%s'", dir);
|
not_found(&hdr, "Repository not exported: '%s'", dir);
|
||||||
|
|
2
refs.c
2
refs.c
|
@ -1284,7 +1284,7 @@ int parse_hide_refs_config(const char *var, const char *value, const char *secti
|
||||||
}
|
}
|
||||||
string_list_append(hide_refs, ref);
|
string_list_append(hide_refs, ref);
|
||||||
}
|
}
|
||||||
return 0;
|
return git_default_config(var, value, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ref_is_hidden(const char *refname, const char *refname_full)
|
int ref_is_hidden(const char *refname, const char *refname_full)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче