Skip to content

Commit 4b16986

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 5c24a13 + 411bbb5 commit 4b16986

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
@@ -155,6 +155,9 @@ static int git_init_db_config(const char *k, const char *v, void *cb)
155155
if (!strcmp(k, "init.templatedir"))
156156
return git_config_pathname(&init_db_template_dir, k, v);
157157

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

@@ -361,6 +364,9 @@ int init_db(const char *git_dir, const char *real_git_dir,
361364
}
362365
startup_info->have_repository = 1;
363366

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

366372
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+
sane_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)