clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
After initializing the config in the newly-created repository, we need to unset GIT_CONFIG so that the global configs are read again. Noticed by Pieter de Bie. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jun 27, 2008 at 13:55 UTC
5b8063b5b0f56f0da345e8dd7c66d3aced1af673
1 file changed
+7
builtin-clone.c
+7
@@ -420,6 +420,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
420
fprintf(stderr, "Initialize %s\n", git_dir);
421
init_db(option_template, option_quiet ? INIT_DB_QUIET : 0);
422
423
+ /*
424
+ * At this point, the config exists, so we do not need the
425
+ * environment variable. We actually need to unset it, too, to
426
+ * re-enable parsing of the global configs.
427
+ */
428
+ unsetenv(CONFIG_ENVIRONMENT);
429
+
430
if (option_reference)
431
setup_reference(git_dir);
432