Skip to content

Commit 13c6014

Browse files
committed
Merge branch 'unhidden-git'
It has been reported that core.hideDotFiles=false stopped working... This topic branch fixes it. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents c2473ae + f04034d commit 13c6014

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

builtin/init-db.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ static int git_init_db_config(const char *k, const char *v, void *cb)
154154
if (!strcmp(k, "init.templatedir"))
155155
return git_config_pathname(&init_db_template_dir, k, v);
156156

157+
if (starts_with(k, "core."))
158+
return platform_core_config(k, v, cb);
159+
157160
return 0;
158161
}
159162

@@ -360,6 +363,9 @@ int init_db(const char *git_dir, const char *real_git_dir,
360363
}
361364
startup_info->have_repository = 1;
362365

366+
/* Just look for `init.templatedir` and `core.hidedotfiles` */
367+
git_config(git_init_db_config, NULL);
368+
363369
safe_create_dir(git_dir, 0);
364370

365371
init_is_bare_repository = is_bare_repository();

t/t0001-init.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,18 @@ test_expect_success 're-init from a linked worktree' '
453453
)
454454
'
455455

456+
test_expect_success MINGW 'core.hidedotfiles = false' '
457+
git config --global core.hidedotfiles false &&
458+
rm -rf newdir &&
459+
(
460+
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
461+
mkdir newdir &&
462+
cd newdir &&
463+
git init
464+
) &&
465+
! is_hidden newdir/.git
466+
'
467+
456468
test_expect_success MINGW 'redirect std handles' '
457469
GIT_REDIRECT_STDOUT=output.txt git rev-parse --git-dir &&
458470
test .git = "$(cat output.txt)" &&

0 commit comments

Comments
 (0)