Skip to content

Commit 3d356f0

Browse files
committed
Merge branch 'long-paths'
2 parents 4785536 + df47475 commit 3d356f0

39 files changed

+480
-57
lines changed

Documentation/config/core.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,13 @@ core.fscache::
570570
Git for Windows uses this to bulk-read and cache lstat data of entire
571571
directories (instead of doing lstat file by file).
572572

573+
core.longpaths::
574+
Enable long path (> 260) support for builtin commands in Git for
575+
Windows. This is disabled by default, as long paths are not supported
576+
by Windows Explorer, cmd.exe and the Git for Windows tool chain
577+
(msys, bash, tcl, perl...). Only enable this if you know what you're
578+
doing and are prepared to live with a few quirks.
579+
573580
core.unsetenvvars::
574581
Windows-only: comma-separated list of environment variables'
575582
names that need to be unset before spawning any other process.

builtin/archive.c

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

1314
static void create_output_file(const char *output_file)
1415
{
@@ -95,6 +96,7 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
9596
OPT_END()
9697
};
9798

99+
git_config(git_default_config, NULL);
98100
argc = parse_options(argc, argv, prefix, local_opts, NULL,
99101
PARSE_OPT_KEEP_ALL);
100102

builtin/bisect--helper.c

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

1314
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
1415
static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
@@ -894,6 +895,7 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
894895
};
895896
struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };
896897

898+
git_config(git_default_config, NULL);
897899
argc = parse_options(argc, argv, prefix, options,
898900
git_bisect_helper_usage,
899901
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_UNKNOWN);

builtin/bundle.c

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

78
/*
89
* Basic handler for bundle files to connect repositories via sneakernet.
@@ -109,6 +110,7 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
109110
};
110111
const char* bundle_file;
111112

113+
git_config(git_default_config, NULL);
112114
argc = parse_options_cmd_bundle(argc, argv, prefix,
113115
builtin_bundle_verify_usage, options, &bundle_file);
114116
/* bundle internals use argv[1] as further parameters */

builtin/check-ref-format.c

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

1011
static const char builtin_check_ref_format_usage[] =
1112
"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)
5859
int flags = 0;
5960
const char *refname;
6061

62+
git_config(git_default_config, NULL);
6163
if (argc == 2 && !strcmp(argv[1], "-h"))
6264
usage(builtin_check_ref_format_usage);
6365

builtin/clone.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
962962

963963
struct strvec ref_prefixes = STRVEC_INIT;
964964

965+
git_config(platform_core_config, NULL);
966+
965967
packet_trace_identity("clone");
966968
argc = parse_options(argc, argv, prefix, builtin_clone_options,
967969
builtin_clone_usage, 0);

builtin/column.c

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

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

builtin/credential-store.c

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

78
static struct lock_file credential_lock;
89

@@ -161,6 +162,8 @@ int cmd_credential_store(int argc, const char **argv, const char *prefix)
161162

162163
umask(077);
163164

165+
git_config(git_default_config, NULL);
166+
164167
argc = parse_options(argc, (const char **)argv, prefix, options, usage, 0);
165168
if (argc != 1)
166169
usage_with_options(usage, options);

builtin/credential.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "git-compat-util.h"
22
#include "credential.h"
33
#include "builtin.h"
4+
#include "config.h"
45

56
static const char usage_msg[] =
67
"git credential [fill|approve|reject]";
@@ -10,6 +11,8 @@ int cmd_credential(int argc, const char **argv, const char *prefix)
1011
const char *op;
1112
struct credential c = CREDENTIAL_INIT;
1213

14+
git_config(git_default_config, NULL);
15+
1316
if (argc != 2 || !strcmp(argv[1], "-h"))
1417
usage(usage_msg);
1518
op = argv[1];

builtin/fetch-pack.c

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

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

61+
git_config(git_default_config, NULL);
6062
fetch_if_missing = 0;
6163

6264
packet_trace_identity("fetch-pack");

0 commit comments

Comments
 (0)