Skip to content

Commit

Permalink
Merge branch 'unhidden-git'
Browse files Browse the repository at this point in the history
It has been reported that core.hideDotFiles=false stopped working...
This topic branch fixes it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Oct 19, 2017
2 parents c09b8a9 + 07fbe25 commit 80b214f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/init-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ static int git_init_db_config(const char *k, const char *v, void *cb)
if (!strcmp(k, "init.templatedir"))
return git_config_pathname(&init_db_template_dir, k, v);

if (starts_with(k, "core."))
return platform_core_config(k, v, cb);

return 0;
}

Expand Down Expand Up @@ -360,6 +363,9 @@ int init_db(const char *git_dir, const char *real_git_dir,
}
startup_info->have_repository = 1;

/* Just look for `init.templatedir` and `core.hidedotfiles` */
git_config(git_init_db_config, NULL);

safe_create_dir(git_dir, 0);

init_is_bare_repository = is_bare_repository();
Expand Down
12 changes: 12 additions & 0 deletions t/t0001-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,18 @@ test_expect_success 're-init from a linked worktree' '
)
'

test_expect_success MINGW 'core.hidedotfiles = false' '
git config --global core.hidedotfiles false &&
rm -rf newdir &&
(
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
mkdir newdir &&
cd newdir &&
git init
) &&
! is_hidden newdir/.git
'

test_expect_success MINGW 'redirect std handles' '
GIT_REDIRECT_STDOUT=output.txt git rev-parse --git-dir &&
test .git = "$(cat output.txt)" &&
Expand Down

0 comments on commit 80b214f

Please sign in to comment.