summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e91b6c5)
raw | patch | inline | side by side (parent: e91b6c5)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Tue, 15 Mar 2011 09:04:49 +0000 (04:04 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Mar 2011 19:23:30 +0000 (12:23 -0700) |
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>
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>
builtin/config.c | patch | blob | history | |
cache.h | patch | blob | history | |
config.c | patch | blob | history | |
t/t0001-init.sh | patch | blob | history | |
t/t5601-clone.sh | patch | blob | history | |
t/t9130-git-svn-authors-file.sh | patch | blob | history | |
t/test-lib.sh | patch | blob | history |
diff --git a/builtin/config.c b/builtin/config.c
index 76be0b786fd52f181f91b5ad3bdef891068946f1..3e3c52849773348a568241f678b3e3ee2e8d123a 100644 (file)
--- a/builtin/config.c
+++ b/builtin/config.c
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();
index d0bbc9120e33e96ad89a0d520b1da6359086c700..a8ef37a6903ee9768fc12df345fd47af5107723f 100644 (file)
--- a/cache.h
+++ b/cache.h
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);
diff --git a/config.c b/config.c
index b94de8f51c860b2804c8e16a33343d55e32c2733..217a77ddaf43c8eca6d7d4aea06a5ac091880f76 100644 (file)
--- a/config.c
+++ b/config.c
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;
}
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);
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index f6849932112f1bbea1dafad09150857a707b64e4..ce4ba1379ef05066cc697cdc7fdf53f8c40f58ee 100755 (executable)
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
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 &&
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 &&
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 &&
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 &&
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 987e0c846309a8a49dbe31ce292edd55342217b3..3ca275cc671502febd8397e1828c612f575c5b89 100755 (executable)
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
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 &&
index ec0a10661409d24c77bf2061bd8a554bfb565d74..b324c491c52eb0fa39d713cc5f227d134c1adb01 100755 (executable)
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 \
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 00f23fc975eaea72e5502e377339bb37cde4ae71..8893406969b510aa146449706134c3825290f90c 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
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