Merge branch 'js/init-db-update-for-mingw'
authorJunio C Hamano <gitster@pobox.com>
Tue, 16 Apr 2019 10:28:05 +0000 (19:28 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Apr 2019 10:28:05 +0000 (19:28 +0900)
"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

1  2 
builtin/init-db.c
diff --combined builtin/init-db.c
index 6090217025a27281b0723537e570357bf9c86629,190754ba3941f214e0850b6578e42471c0b6bece..6ca002893f47516ee8963db09d60b3716b60a205
@@@ -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)
        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();