]> git.ipfire.org Git - thirdparty/git.git/commit
mingw: respect core.hidedotfiles = false in git-init again
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 11 Mar 2019 20:10:58 +0000 (13:10 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Mar 2019 07:30:26 +0000 (16:30 +0900)
commit287853392a2bb9199c9fa567d8bc95b7c1275139
tree3d9f10c919423d651e3cd81b0b3353c9ef771f12
parent6053c04b88d28b31d752dc8783ff59324b6a82f7
mingw: respect core.hidedotfiles = false in git-init again

This is a brown paper bag. When adding the tests, we actually failed
to verify that the config variable is heeded in git-init at all. And
when changing the original patch that marked the .git/ directory as
hidden after reading the config, it was lost on this developer that
the new code would use the hide_dotfiles variable before the config
was read.

The fix is obvious: read the (limited, pre-init) config *before*
creating the .git/ directory.

Please note that we cannot remove the identical-looking `git_config()`
call from `create_default_files()`: we create the `.git/` directory
between those calls. If we removed it, and if the parent directory is
in a Git worktree, and if that worktree's `.git/config` contained any
`init.templatedir` setting, we would all of a sudden pick that up.

This fixes https://github.com/git-for-windows/git/issues/789

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/init-db.c
t/t0001-init.sh