summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2016-09-12 20:24:19 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-13 15:45:45 -0700
commit7c0a842b46391230661d17ad758efa6b4eccdb93 (patch)
tree59926a9fbc10297842b413fa6b8758a2fc1860cc
parentconfig: only read .git/config from configured repos (diff)
downloadtgif-7c0a842b46391230661d17ad758efa6b4eccdb93.tar.xz
init: expand comments explaining config trickery
git-init may copy "config" from the templates directory and then re-read it. There are some comments explaining what's going on here, but they are not grouped very well with the matching code. Let's rearrange and expand them. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/init-db.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index b2d8d40a67..0b0557138d 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -191,16 +191,19 @@ static int create_default_files(const char *template_path)
/* Just look for `init.templatedir` */
git_config(git_init_db_config, NULL);
- /* First copy the templates -- we might have the default
+ /*
+ * First copy the templates -- we might have the default
* config file there, in which case we would want to read
* from it after installing.
*/
copy_templates(template_path);
-
git_config(git_default_config, NULL);
- is_bare_repository_cfg = init_is_bare_repository;
- /* reading existing config may have overwrote it */
+ /*
+ * We must make sure command-line options continue to override any
+ * values we might have just re-read from the config.
+ */
+ is_bare_repository_cfg = init_is_bare_repository;
if (init_shared_repository != -1)
set_shared_repository(init_shared_repository);