Skip to content

Commit ba96aa6

Browse files
committed
Merge branch 'jc/no-git-config-in-clone'
We stopped paying attention to $GIT_CONFIG environment that points at a single configuration file from any command other than "git config" quite a while ago, but "git clone" internally set, exported, and then unexported the variable during its operation unnecessarily. * jc/no-git-config-in-clone: clone: do not export and unexport GIT_CONFIG
2 parents 2532d89 + 3f4f4cc commit ba96aa6

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

builtin/clone.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
767767
atexit(remove_junk);
768768
sigchain_push_common(remove_junk_on_signal);
769769

770-
setenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
771-
772770
if (safe_create_leading_directories_const(git_dir) < 0)
773771
die(_("could not create leading directories of '%s'"), git_dir);
774772

@@ -787,13 +785,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
787785
init_db(option_template, INIT_DB_QUIET);
788786
write_config(&option_config);
789787

790-
/*
791-
* At this point, the config exists, so we do not need the
792-
* environment variable. We actually need to unset it, too, to
793-
* re-enable parsing of the global configs.
794-
*/
795-
unsetenv(CONFIG_ENVIRONMENT);
796-
797788
git_config(git_default_config, NULL);
798789

799790
if (option_bare) {

0 commit comments

Comments
 (0)