Skip to content

Commit

Permalink
clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jun 30, 2008
1 parent bc0c0d8 commit 5b8063b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builtin-clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
fprintf(stderr, "Initialize %s\n", git_dir);
init_db(option_template, option_quiet ? INIT_DB_QUIET : 0);

/*
* At this point, the config exists, so we do not need the
* environment variable. We actually need to unset it, too, to
* re-enable parsing of the global configs.
*/
unsetenv(CONFIG_ENVIRONMENT);

if (option_reference)
setup_reference(git_dir);

Expand Down

0 comments on commit 5b8063b

Please sign in to comment.