{"thread":{"id":"32625","subject":"[PATCH] clone: do not export and unexport GIT_CONFIG","startedAt":"2013-01-14T18:11:13Z","lastAt":"2013-01-14T18:11:13Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"206820","messageId":"7v1udneita.fsf@alter.siamese.dyndns.org","threadId":"32625","inReplyTo":null,"subject":"[PATCH] clone: do not export and unexport GIT_CONFIG","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-14T18:11:13Z","receivedAt":"2013-01-14T18:11:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Earlier, dc87183 (use GIT_CONFIG only in \"git config\", not other\nprograms, 2008-06-30) made sure that the environment variable is\nnever used outside \"git config\", but \"git clone\", after creating a\ndirectory for the new repository and until the init_db() function\npopulates its .git/ directory, exported the variable for no good\nreason.  No hook will run from init_db() and more importantly no\nhook can run until init_db() finishes creation of the new\nrepository, so it cannot be used by any invocation of \"git config\"\nby definition.\n\nStop doing the useless export/unexport.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/clone.c | 9 ---------\n 1 file changed, 9 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex a4d8d25..6f0c1c6 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -714,8 +714,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tatexit(remove_junk);\n \tsigchain_push_common(remove_junk_on_signal);\n \n-\tsetenv(CONFIG_ENVIRONMENT, mkpath(\"%s/config\", git_dir), 1);\n-\n \tif (safe_create_leading_directories_const(git_dir) < 0)\n \t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \n@@ -732,13 +730,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tinit_db(option_template, INIT_DB_QUIET);\n \twrite_config(&option_config);\n \n-\t/*\n-\t * At this point, the config exists, so we do not need the\n-\t * environment variable.  We actually need to unset it, too, to\n-\t * re-enable parsing of the global configs.\n-\t */\n-\tunsetenv(CONFIG_ENVIRONMENT);\n-\n \tgit_config(git_default_config, NULL);\n \n \tif (option_bare) {\n-- \n1.8.1.407.g91cb4ac\n"}]}