Skip to content

Commit 9e699f5

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 92eea3a + d5dcfe8 commit 9e699f5

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

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

@@ -359,6 +362,9 @@ int init_db(const char *git_dir, const char *real_git_dir,
359362
}
360363
startup_info->have_repository = 1;
361364

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

364370
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
@@ -410,4 +410,16 @@ test_expect_success 're-init from a linked worktree' '
410410
)
411411
'
412412

413+
test_expect_success MINGW 'core.hidedotfiles = false' '
414+
git config --global core.hidedotfiles false &&
415+
rm -rf newdir &&
416+
(
417+
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
418+
mkdir newdir &&
419+
cd newdir &&
420+
git init
421+
) &&
422+
! is_hidden newdir/.git
423+
'
424+
413425
test_done

0 commit comments

Comments
 (0)