Skip to content

Commit af59c63

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
init: do parse _all_ core.* settings early
In Git for Windows, `has_symlinks` is set to 0 by default. Therefore, we need to parse the config setting `core.symlinks` to know if it has been set to `true`. In `git init`, we must do that before copying the templates because they might contain symbolic links. Even if the support for symbolic links on Windows has not made it to upstream Git yet, we really should make sure that all the `core.*` settings are parsed before proceeding, as they might very well change the behavior of `git init` in a way the user intended. This fixes #3414 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e7a97c3 commit af59c63

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

builtin/init-db.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ int init_db(const char *git_dir, const char *real_git_dir,
410410
startup_info->have_repository = 1;
411411

412412
/* Ensure `core.hidedotfiles` is processed */
413-
git_config(platform_core_config, NULL);
413+
git_config(git_default_core_config, NULL);
414414

415415
safe_create_dir(git_dir, 0);
416416

config.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ int git_config_color(char *dest, const char *var, const char *value)
12941294
return 0;
12951295
}
12961296

1297-
static int git_default_core_config(const char *var, const char *value, void *cb)
1297+
int git_default_core_config(const char *var, const char *value, void *cb)
12981298
{
12991299
/* This needs a better name */
13001300
if (!strcmp(var, "core.filemode")) {

config.h

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ struct config_options {
120120
typedef int (*config_fn_t)(const char *, const char *, void *);
121121

122122
int git_default_config(const char *, const char *, void *);
123+
int git_default_core_config(const char *var, const char *value, void *cb);
123124

124125
/**
125126
* Read a specific file in git-config format.

0 commit comments

Comments
 (0)