summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-19 01:28:15 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-19 01:51:51 -0800
commitd4ebc36c5ee964592303c59260417b758d024c31 (patch)
treed26506bdce4e91e5eb0df875e8661fa6ac8992df /config.c
parent75c384efb52d0e3eb1e8c2f53668b4066fe6a8d6 (diff)
downloadgit-d4ebc36c5ee964592303c59260417b758d024c31.tar.gz
Use preprocessor constants for environment variable names.
We broke the discipline Linus set up to allow compiler help us avoid typos in environment names in the early days of git over time. This defines a handful preprocessor constants for environment variable names used in relatively core parts of the system. I've left out variable names specific to subsystems such as HTTP and SSL as I do not think they are big problems. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'config.c')
-rw-r--r--config.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/config.c b/config.c
index 663993fefa..6a4224e98c 100644
--- a/config.c
+++ b/config.c
@@ -350,10 +350,10 @@ int git_config(config_fn_t fn)
* $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. */
- filename = getenv("GIT_CONFIG");
+ filename = getenv(CONFIG_ENVIRONMENT);
if (!filename) {
home = getenv("HOME");
- filename = getenv("GIT_CONFIG_LOCAL");
+ filename = getenv(CONFIG_LOCAL_ENVIRONMENT);
if (!filename)
filename = repo_config = xstrdup(git_path("config"));
}
@@ -544,9 +544,9 @@ int git_config_set_multivar(const char* key, const char* value,
char* lock_file;
const char* last_dot = strrchr(key, '.');
- config_filename = getenv("GIT_CONFIG");
+ config_filename = getenv(CONFIG_ENVIRONMENT);
if (!config_filename) {
- config_filename = getenv("GIT_CONFIG_LOCAL");
+ config_filename = getenv(CONFIG_LOCAL_ENVIRONMENT);
if (!config_filename)
config_filename = git_path("config");
}
@@ -754,9 +754,9 @@ int git_config_rename_section(const char *old_name, const char *new_name)
int out_fd;
char buf[1024];
- config_filename = getenv("GIT_CONFIG");
+ config_filename = getenv(CONFIG_ENVIRONMENT);
if (!config_filename) {
- config_filename = getenv("GIT_CONFIG_LOCAL");
+ config_filename = getenv(CONFIG_LOCAL_ENVIRONMENT);
if (!config_filename)
config_filename = git_path("config");
}