diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-04-16 19:28:05 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-04-16 19:28:05 +0900 |
| commit | 63643865d2505bd7586ace4481d5f1f373dacf2c (patch) | |
| tree | 70190831c15add44e915120ff942b9ad1d10508b | |
| parent | aa1edf14f936e37902fefd2f73389616d1e1e7ac (diff) | |
| parent | 287853392a2bb9199c9fa567d8bc95b7c1275139 (diff) | |
| download | git-63643865d2505bd7586ace4481d5f1f373dacf2c.tar.gz | |
Merge branch 'js/init-db-update-for-mingw'
"git init" forgot to read platform-specific repository
configuration, which made Windows port to ignore settings of
core.hidedotfiles, for example.
* js/init-db-update-for-mingw:
mingw: respect core.hidedotfiles = false in git-init again
| -rw-r--r-- | builtin/init-db.c | 7 | ||||
| -rwxr-xr-x | t/t0001-init.sh | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c index 6090217025..6ca002893f 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -156,6 +156,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; } @@ -186,6 +189,7 @@ static int create_default_files(const char *template_path, struct strbuf err = STRBUF_INIT; /* Just look for `init.templatedir` */ + init_db_template_dir = NULL; /* re-set in case it was set before */ git_config(git_init_db_config, NULL); /* @@ -362,6 +366,9 @@ int init_db(const char *git_dir, const char *real_git_dir, } startup_info->have_repository = 1; + /* Just look for `core.hidedotfiles` */ + git_config(git_init_db_config, NULL); + safe_create_dir(git_dir, 0); init_is_bare_repository = is_bare_repository(); diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 5e27604b24..1f462204ea 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -454,6 +454,17 @@ 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 && + mkdir newdir && + ( + sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG && + git -C newdir 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)" && |
