summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-14 11:48:14 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-02-20 07:05:16 (GMT)
commit32043c9f8c60fc03b0b6a324c559d98094729323 (patch)
treeadd1d32a22e55a41cc20fbd562d8cb6f577770df /config.c
parent437b1b20df4b356c9342dac8d38849f24ef44f27 (diff)
downloadgit-32043c9f8c60fc03b0b6a324c559d98094729323.zip
git-32043c9f8c60fc03b0b6a324c559d98094729323.tar.gz
git-32043c9f8c60fc03b0b6a324c559d98094729323.tar.bz2
config: read system-wide defaults from /etc/gitconfig
The settings in /etc/gitconfig can be overridden in ~/.gitconfig, which in turn can be overridden in .git/config. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'config.c')
-rw-r--r--config.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/config.c b/config.c
index d821071..b0c0948 100644
--- a/config.c
+++ b/config.c
@@ -383,6 +383,8 @@ int git_config(config_fn_t fn)
* config file otherwise. */
filename = getenv(CONFIG_ENVIRONMENT);
if (!filename) {
+ if (!access(ETC_GITCONFIG, R_OK))
+ ret += git_config_from_file(fn, ETC_GITCONFIG);
home = getenv("HOME");
filename = getenv(CONFIG_LOCAL_ENVIRONMENT);
if (!filename)