Skip to content

Commit 5b8063b

Browse files
dschogitster
authored andcommitted
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>
1 parent bc0c0d8 commit 5b8063b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

builtin-clone.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
420420
fprintf(stderr, "Initialize %s\n", git_dir);
421421
init_db(option_template, option_quiet ? INIT_DB_QUIET : 0);
422422

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+
423430
if (option_reference)
424431
setup_reference(git_dir);
425432

0 commit comments

Comments
 (0)