Skip to content

Commit

Permalink
Get rid of the last remnants of GIT_CONFIG_LOCAL
Browse files Browse the repository at this point in the history
In dc87183(Only use GIT_CONFIG in "git config", not other programs),
GIT_CONFIG_LOCAL was rested in peace, in favor of not reading
/etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set.

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 Dec 15, 2008
1 parent 390c348 commit 8befc50
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,7 @@ int git_config(config_fn_t fn, void *data)
char *repo_config = NULL;
const char *home = NULL;

/* $GIT_CONFIG makes git read _only_ the given config file,
* $GIT_CONFIG_LOCAL will make it process it in addition to the
* global config file, the same way it would the per-repository
* config file otherwise. */
/* Setting $GIT_CONFIG makes git read _only_ the given config file. */
if (config_exclusive_filename)
return git_config_from_file(fn, config_exclusive_filename, data);
if (git_config_system() && !access(git_etc_gitconfig(), R_OK))
Expand Down
3 changes: 1 addition & 2 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -5015,8 +5015,7 @@ sub minimize_connections {
}
}
if (@emptied) {
my $file = $ENV{GIT_CONFIG} || $ENV{GIT_CONFIG_LOCAL} ||
"$ENV{GIT_DIR}/config";
my $file = $ENV{GIT_CONFIG} || "$ENV{GIT_DIR}/config";
print STDERR <<EOF;
The following [svn-remote] sections in your config file ($file) are empty
and can be safely removed:
Expand Down
2 changes: 1 addition & 1 deletion t/t5400-send-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ test_expect_success \
! test -f victim/.git/refs/heads/extra
'

unset GIT_CONFIG GIT_CONFIG_LOCAL
unset GIT_CONFIG
HOME=`pwd`/no-such-directory
export HOME ;# this way we force the victim/.git/config to be used.

Expand Down
1 change: 0 additions & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ PATH=$TEST_DIRECTORY/..:$PATH
GIT_EXEC_PATH=$(pwd)/..
GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
unset GIT_CONFIG
unset GIT_CONFIG_LOCAL
GIT_CONFIG_NOSYSTEM=1
GIT_CONFIG_NOGLOBAL=1
export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL
Expand Down

0 comments on commit 8befc50

Please sign in to comment.