From: Junio C Hamano Date: Tue, 16 Apr 2019 10:28:05 +0000 (+0900) Subject: Merge branch 'js/init-db-update-for-mingw' X-Git-Tag: v2.22.0-rc0~113 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/63643865d2505bd7586ace4481d5f1f373dacf2c?ds=inline;hp=-c 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 --- 63643865d2505bd7586ace4481d5f1f373dacf2c diff --combined builtin/init-db.c index 6090217025,190754ba39..6ca002893f --- a/builtin/init-db.c +++ b/builtin/init-db.c @@@ -96,7 -96,7 +96,7 @@@ static void copy_templates(const char * struct strbuf path = STRBUF_INIT; struct strbuf template_path = STRBUF_INIT; size_t template_len; - struct repository_format template_format; + struct repository_format template_format = REPOSITORY_FORMAT_INIT; struct strbuf err = STRBUF_INIT; DIR *dir; char *to_free = NULL; @@@ -148,7 -148,6 +148,7 @@@ free_return free(to_free); strbuf_release(&path); strbuf_release(&template_path); + clear_repository_format(&template_format); } static int git_init_db_config(const char *k, const char *v, void *cb) @@@ -156,6 -155,9 +156,9 @@@ 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 -188,7 +189,7 @@@ static int create_default_files(const c 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 -365,9 +366,9 @@@ int init_db(const char *git_dir, const } 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();