Skip to content

Commit 8f323c0

Browse files
jrngitster
authored andcommitted
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>
1 parent e91b6c5 commit 8f323c0

File tree

7 files changed

+4
-16
lines changed

7 files changed

+4
-16
lines changed

builtin/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static int get_value(const char *key_, const char *regex_)
160160
if (!local) {
161161
const char *home = getenv("HOME");
162162
local = repo_config = git_pathdup("config");
163-
if (git_config_global() && home)
163+
if (home)
164164
global = xstrdup(mkpath("%s/.gitconfig", home));
165165
if (git_config_system())
166166
system_wide = git_etc_gitconfig();

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,6 @@ extern const char *git_etc_gitconfig(void);
10201020
extern int check_repository_format_version(const char *var, const char *value, void *cb);
10211021
extern int git_env_bool(const char *, int);
10221022
extern int git_config_system(void);
1023-
extern int git_config_global(void);
10241023
extern int config_error_nonbool(const char *);
10251024
extern const char *get_log_output_encoding(void);
10261025
extern const char *get_commit_output_encoding(void);

config.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -826,11 +826,6 @@ int git_config_system(void)
826826
return !git_env_bool("GIT_CONFIG_NOSYSTEM", 0);
827827
}
828828

829-
int git_config_global(void)
830-
{
831-
return !git_env_bool("GIT_CONFIG_NOGLOBAL", 0);
832-
}
833-
834829
int git_config_from_parameters(config_fn_t fn, void *data)
835830
{
836831
static int loaded_environment;
@@ -862,7 +857,7 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)
862857
}
863858

864859
home = getenv("HOME");
865-
if (git_config_global() && home) {
860+
if (home) {
866861
char *user_config = xstrdup(mkpath("%s/.gitconfig", home));
867862
if (!access(user_config, R_OK)) {
868863
ret += git_config_from_file(fn, user_config, data);

t/t0001-init.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test_expect_success 'plain nested in bare' '
4747

4848
test_expect_success 'plain through aliased command, outside any git repo' '
4949
(
50-
sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG_NOGLOBAL &&
50+
sane_unset GIT_DIR GIT_WORK_TREE &&
5151
HOME=$(pwd)/alias-config &&
5252
export HOME &&
5353
mkdir alias-config &&
@@ -231,7 +231,6 @@ test_expect_success 'init with init.templatedir set' '
231231
git config -f "$test_config" init.templatedir "${HOME}/templatedir-source" &&
232232
mkdir templatedir-set &&
233233
cd templatedir-set &&
234-
sane_unset GIT_CONFIG_NOGLOBAL &&
235234
sane_unset GIT_TEMPLATE_DIR &&
236235
NO_SET_GIT_TEMPLATE_DIR=t &&
237236
export NO_SET_GIT_TEMPLATE_DIR &&
@@ -243,7 +242,6 @@ test_expect_success 'init with init.templatedir set' '
243242
test_expect_success 'init --bare/--shared overrides system/global config' '
244243
(
245244
test_config="$HOME"/.gitconfig &&
246-
sane_unset GIT_CONFIG_NOGLOBAL &&
247245
git config -f "$test_config" core.bare false &&
248246
git config -f "$test_config" core.sharedRepository 0640 &&
249247
mkdir init-bare-shared-override &&
@@ -258,7 +256,6 @@ test_expect_success 'init --bare/--shared overrides system/global config' '
258256
test_expect_success 'init honors global core.sharedRepository' '
259257
(
260258
test_config="$HOME"/.gitconfig &&
261-
sane_unset GIT_CONFIG_NOGLOBAL &&
262259
git config -f "$test_config" core.sharedRepository 0666 &&
263260
mkdir shared-honor-global &&
264261
cd shared-honor-global &&

t/t5601-clone.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ test_expect_success 'clone a void' '
164164
test_expect_success 'clone respects global branch.autosetuprebase' '
165165
(
166166
test_config="$HOME/.gitconfig" &&
167-
unset GIT_CONFIG_NOGLOBAL &&
168167
git config -f "$test_config" branch.autosetuprebase remote &&
169168
rm -fr dst &&
170169
git clone src dst &&

t/t9130-git-svn-authors-file.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ test_expect_success 'fresh clone with svn.authors-file in config' '
9696
rm -r "$GIT_DIR" &&
9797
test x = x"$(git config svn.authorsfile)" &&
9898
test_config="$HOME"/.gitconfig &&
99-
unset GIT_CONFIG_NOGLOBAL &&
10099
unset GIT_DIR &&
101100
unset GIT_CONFIG &&
102101
git config --global \

t/test-lib.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,8 @@ fi
947947
GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt
948948
unset GIT_CONFIG
949949
GIT_CONFIG_NOSYSTEM=1
950-
GIT_CONFIG_NOGLOBAL=1
951950
GIT_ATTR_NOSYSTEM=1
952-
export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL GIT_ATTR_NOSYSTEM
951+
export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM
953952

954953
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
955954

0 commit comments

Comments
 (0)