mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
config: drop support for GIT_CONFIG_NOGLOBAL
Now that test-lib sets $HOME to protect against pollution from user settings, GIT_CONFIG_NOGLOBAL is not needed for use by the test suite any more. And as luck would have it, a quick code search reveals no other users in the wild. This patch does not affect GIT_CONFIG_NOSYSTEM, which is still needed. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e91b6c5049
commit
8f323c00dd
@ -160,7 +160,7 @@ static int get_value(const char *key_, const char *regex_)
|
||||
if (!local) {
|
||||
const char *home = getenv("HOME");
|
||||
local = repo_config = git_pathdup("config");
|
||||
if (git_config_global() && home)
|
||||
if (home)
|
||||
global = xstrdup(mkpath("%s/.gitconfig", home));
|
||||
if (git_config_system())
|
||||
system_wide = git_etc_gitconfig();
|
||||
|
1
cache.h
1
cache.h
@ -1020,7 +1020,6 @@ extern const char *git_etc_gitconfig(void);
|
||||
extern int check_repository_format_version(const char *var, const char *value, void *cb);
|
||||
extern int git_env_bool(const char *, int);
|
||||
extern int git_config_system(void);
|
||||
extern int git_config_global(void);
|
||||
extern int config_error_nonbool(const char *);
|
||||
extern const char *get_log_output_encoding(void);
|
||||
extern const char *get_commit_output_encoding(void);
|
||||
|
7
config.c
7
config.c
@ -826,11 +826,6 @@ int git_config_system(void)
|
||||
return !git_env_bool("GIT_CONFIG_NOSYSTEM", 0);
|
||||
}
|
||||
|
||||
int git_config_global(void)
|
||||
{
|
||||
return !git_env_bool("GIT_CONFIG_NOGLOBAL", 0);
|
||||
}
|
||||
|
||||
int git_config_from_parameters(config_fn_t fn, void *data)
|
||||
{
|
||||
static int loaded_environment;
|
||||
@ -862,7 +857,7 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)
|
||||
}
|
||||
|
||||
home = getenv("HOME");
|
||||
if (git_config_global() && home) {
|
||||
if (home) {
|
||||
char *user_config = xstrdup(mkpath("%s/.gitconfig", home));
|
||||
if (!access(user_config, R_OK)) {
|
||||
ret += git_config_from_file(fn, user_config, data);
|
||||
|
@ -47,7 +47,7 @@ test_expect_success 'plain nested in bare' '
|
||||
|
||||
test_expect_success 'plain through aliased command, outside any git repo' '
|
||||
(
|
||||
sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG_NOGLOBAL &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
HOME=$(pwd)/alias-config &&
|
||||
export HOME &&
|
||||
mkdir alias-config &&
|
||||
@ -231,7 +231,6 @@ test_expect_success 'init with init.templatedir set' '
|
||||
git config -f "$test_config" init.templatedir "${HOME}/templatedir-source" &&
|
||||
mkdir templatedir-set &&
|
||||
cd templatedir-set &&
|
||||
sane_unset GIT_CONFIG_NOGLOBAL &&
|
||||
sane_unset GIT_TEMPLATE_DIR &&
|
||||
NO_SET_GIT_TEMPLATE_DIR=t &&
|
||||
export NO_SET_GIT_TEMPLATE_DIR &&
|
||||
@ -243,7 +242,6 @@ test_expect_success 'init with init.templatedir set' '
|
||||
test_expect_success 'init --bare/--shared overrides system/global config' '
|
||||
(
|
||||
test_config="$HOME"/.gitconfig &&
|
||||
sane_unset GIT_CONFIG_NOGLOBAL &&
|
||||
git config -f "$test_config" core.bare false &&
|
||||
git config -f "$test_config" core.sharedRepository 0640 &&
|
||||
mkdir init-bare-shared-override &&
|
||||
@ -258,7 +256,6 @@ test_expect_success 'init --bare/--shared overrides system/global config' '
|
||||
test_expect_success 'init honors global core.sharedRepository' '
|
||||
(
|
||||
test_config="$HOME"/.gitconfig &&
|
||||
sane_unset GIT_CONFIG_NOGLOBAL &&
|
||||
git config -f "$test_config" core.sharedRepository 0666 &&
|
||||
mkdir shared-honor-global &&
|
||||
cd shared-honor-global &&
|
||||
|
@ -164,7 +164,6 @@ test_expect_success 'clone a void' '
|
||||
test_expect_success 'clone respects global branch.autosetuprebase' '
|
||||
(
|
||||
test_config="$HOME/.gitconfig" &&
|
||||
unset GIT_CONFIG_NOGLOBAL &&
|
||||
git config -f "$test_config" branch.autosetuprebase remote &&
|
||||
rm -fr dst &&
|
||||
git clone src dst &&
|
||||
|
@ -96,7 +96,6 @@ test_expect_success 'fresh clone with svn.authors-file in config' '
|
||||
rm -r "$GIT_DIR" &&
|
||||
test x = x"$(git config svn.authorsfile)" &&
|
||||
test_config="$HOME"/.gitconfig &&
|
||||
unset GIT_CONFIG_NOGLOBAL &&
|
||||
unset GIT_DIR &&
|
||||
unset GIT_CONFIG &&
|
||||
git config --global \
|
||||
|
@ -947,9 +947,8 @@ fi
|
||||
GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt
|
||||
unset GIT_CONFIG
|
||||
GIT_CONFIG_NOSYSTEM=1
|
||||
GIT_CONFIG_NOGLOBAL=1
|
||||
GIT_ATTR_NOSYSTEM=1
|
||||
export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL GIT_ATTR_NOSYSTEM
|
||||
export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM
|
||||
|
||||
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user