diff options
author | Junio C Hamano <junkio@cox.net> | 2006-06-18 21:48:32 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-06-18 21:48:32 -0700 |
commit | 42d504248830452275dbe1c864f0b1771d7b1a05 (patch) | |
tree | 011c7f094bfcdd41f510461c720485c8fbf1791e /config.c | |
parent | Merge branch 'master' into next (diff) | |
parent | Support for extracting configuration from different files (diff) | |
download | tgif-42d504248830452275dbe1c864f0b1771d7b1a05.tar.xz |
Merge branch 'pb/config' into next
* pb/config:
Support for extracting configuration from different files
Fix PPC SHA1 routine for large input buffers
Make t8001-annotate and t8002-blame more portable
Remove "refs" field from "struct object"
Make release tarballs friendlier to older tar versions
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -317,7 +317,17 @@ int git_config_from_file(config_fn_t fn, const char *filename) int git_config(config_fn_t fn) { - return git_config_from_file(fn, git_path("config")); + const char *filename = git_path("config"); + /* Forward-compatibility cue: $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. */ + if (getenv("GIT_CONFIG")) { + filename = getenv("GIT_CONFIG"); + } else if (getenv("GIT_CONFIG_LOCAL")) { + filename = getenv("GIT_CONFIG_LOCAL"); + } + return git_config_from_file(fn, filename); } /* |